1
This commit is contained in:
@@ -125,6 +125,25 @@ describe('Finance G3/G4 views', () => {
|
||||
expect(createFinanceSettlementPayment).toHaveBeenCalledWith('701', expect.objectContaining({ amount: 100, voucherFileIds: ['9001'], expectedVersion: 4 }))
|
||||
})
|
||||
|
||||
it('loads payable sources only for the selected supplier and clears them when the supplier changes', async () => {
|
||||
const wrapper = await mountWithAccess(FinanceFormalSettlementPage, ['platform:finance:settlement-ap:list', 'platform:finance:settlement-ap:create'], { kind: 'payable' })
|
||||
const vm = wrapper.vm as unknown as { openCreate(): Promise<void>; createForm: { customerId: string; supplierId: string; feeSourceIds: string[] } }
|
||||
|
||||
await vm.openCreate()
|
||||
vm.createForm.customerId = '10001'
|
||||
await flushPromises()
|
||||
expect(listFinanceFeePool).not.toHaveBeenCalled()
|
||||
|
||||
vm.createForm.supplierId = '301'
|
||||
await flushPromises()
|
||||
expect(listFinanceFeePool).toHaveBeenCalledWith('10001', 'PAYABLE', '301')
|
||||
|
||||
vm.createForm.feeSourceIds = ['81']
|
||||
vm.createForm.supplierId = ''
|
||||
await flushPromises()
|
||||
expect(vm.createForm.feeSourceIds).toEqual([])
|
||||
})
|
||||
|
||||
it('renders request and trace ids when G3 detail loading fails', async () => {
|
||||
vi.mocked(getReconciliationStatement).mockRejectedValueOnce(new ApiResponseError('对账单不可用', 'FIN_404', 404, undefined, 'req-g3-error', 'trace-g3-error'))
|
||||
const wrapper = await mountWithAccess(FinanceCustomerStatementsView, ['platform:finance:customer-statement:list'])
|
||||
@@ -149,4 +168,19 @@ describe('Finance G3/G4 views', () => {
|
||||
expect(listFinanceReceivableSettlements).toHaveBeenLastCalledWith('10001')
|
||||
expect(listFinancePayableSettlements).toHaveBeenLastCalledWith('10001')
|
||||
})
|
||||
|
||||
it('applies settlement list text filters only after an explicit query', async () => {
|
||||
const wrapper = await mountWithAccess(FinanceFormalSettlementPage, ['platform:finance:settlement-ap:list'], { kind: 'payable' })
|
||||
const vm = wrapper.vm as unknown as {
|
||||
filters: Record<string, unknown>
|
||||
filteredRows: FinancePayableSettlement[]
|
||||
load(model: Record<string, unknown>): Promise<void>
|
||||
}
|
||||
vm.filters.settlementNo = 'NOT-FOUND'
|
||||
await flushPromises()
|
||||
expect(vm.filteredRows).toHaveLength(1)
|
||||
await vm.load({ customerId: '', supplierName: '', settlementNo: 'NOT-FOUND', status: '' })
|
||||
await flushPromises()
|
||||
expect(vm.filteredRows).toHaveLength(0)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user