This commit is contained in:
wujinliang
2026-08-26 18:13:12 +08:00
parent a67f6300f8
commit 9eec68f7c5
7 changed files with 49 additions and 15 deletions
@@ -129,6 +129,20 @@ describe('FinanceCustomerArapView G2 operations', () => {
expect(adjustFinanceFeeSource).not.toHaveBeenCalled()
})
it('uses sourceSystem to suppress Firstleg editing when the source type is not in the legacy fallback list', async () => {
const firstlegOtherType = { ...feeSummary, sourceType: 'ORDER_FEE', reviewStatus: 'DRAFT' as const }
vi.mocked(listFinanceFeeSources).mockResolvedValue({ records: [firstlegOtherType], total: 1, pages: 1 })
const wrapper = await mountView(['platform:finance:customer-arap:list', 'platform:finance:fee-source:edit'])
await loadRows(wrapper)
const buttonLabels = wrapper.findAll('button').map((button) => button.text())
expect(buttonLabels).not.toContain('缂栬緫')
const vm = wrapper.vm as unknown as { openMutation(row: Record<string, unknown>, mode: 'EDIT'): Promise<void> }
await vm.openMutation(firstlegOtherType as unknown as Record<string, unknown>, 'EDIT')
expect(getFinanceFeeSource).not.toHaveBeenCalled()
expect(editFinanceFeeSource).not.toHaveBeenCalled()
})
it('loads all customers by default and keeps explicit customer filtering', async () => {
const wrapper = await mountView(['platform:finance:customer-arap:list', 'platform:customer:list'])
expect(listFinanceFeeSources).toHaveBeenCalledWith(expect.objectContaining({ page: 1, size: 20, customerId: undefined, direction: undefined }))