优化
This commit is contained in:
@@ -80,7 +80,7 @@ describe('FinanceCustomerArapView G2 operations', () => {
|
||||
})
|
||||
|
||||
it('shows detail from the list permission but keeps G2 operations independent', async () => {
|
||||
const wrapper = await mountView(['platform:finance:bill:view'])
|
||||
const wrapper = await mountView(['platform:finance:customer-arap:list'])
|
||||
await loadRows(wrapper)
|
||||
|
||||
const buttonLabels = wrapper.findAll('button').map((button) => button.text())
|
||||
@@ -94,7 +94,7 @@ describe('FinanceCustomerArapView G2 operations', () => {
|
||||
})
|
||||
|
||||
it('loads all customers by default and keeps explicit customer filtering', async () => {
|
||||
const wrapper = await mountView(['platform:finance:bill:view', 'platform:customer:list'])
|
||||
const wrapper = await mountView(['platform:finance:customer-arap:list', 'platform:customer:list'])
|
||||
expect(listFinanceFeePool).toHaveBeenCalledWith(undefined, undefined)
|
||||
const vm = wrapper.vm as unknown as { load(model: Record<string, string>): Promise<void> }
|
||||
await vm.load({ customerId: '10001', direction: 'RECEIVABLE', status: '', keyword: '' })
|
||||
@@ -109,7 +109,7 @@ describe('FinanceCustomerArapView G2 operations', () => {
|
||||
{ poolItemId: 'RECEIVABLE:42', feeSourceId: '42', customerId: '10001', direction: 'RECEIVABLE', sourceType: 'INBOUND_FEE', sourceId: '81', sourceVersion: 3, orderId: null, inboundId: '91', containerId: null, feeItemName: '运费', amount: 100, currency: 'CNY', status: 'AVAILABLE', createdAt: '2026-08-11' },
|
||||
{ poolItemId: 'PAYABLE:43', feeSourceId: null, customerId: '10002', direction: 'PAYABLE', sourceType: 'MANUAL_COST', sourceId: '43', sourceVersion: 1, orderId: '11', inboundId: null, containerId: null, feeItemName: '拖车费', amount: 200, currency: 'CNY', status: 'POSTED', createdAt: '2026-08-10' },
|
||||
])
|
||||
const wrapper = await mountView(['platform:finance:bill:view'])
|
||||
const wrapper = await mountView(['platform:finance:customer-arap:list'])
|
||||
const vm = wrapper.vm as unknown as { load(model: Record<string, string>): Promise<void> }
|
||||
await vm.load({ customerId: '', direction: '', status: '', keyword: '' })
|
||||
await flushPromises()
|
||||
@@ -118,7 +118,7 @@ describe('FinanceCustomerArapView G2 operations', () => {
|
||||
})
|
||||
|
||||
it('loads detail and submits review and settlement changes with the returned version', async () => {
|
||||
const wrapper = await mountView(['platform:finance:bill:view', 'platform:finance:fee-source:view', 'platform:finance:fee-source:review', 'platform:finance:fee-source:settlement'])
|
||||
const wrapper = await mountView(['platform:finance:customer-arap:list', 'platform:finance:fee-source:view', 'platform:finance:fee-source:review', 'platform:finance:fee-source:settlement'])
|
||||
await loadRows(wrapper)
|
||||
const vm = wrapper.vm as unknown as {
|
||||
openDetail(row: Record<string, unknown>): Promise<void>
|
||||
@@ -145,7 +145,7 @@ describe('FinanceCustomerArapView G2 operations', () => {
|
||||
|
||||
it('renders request and trace ids when detail loading fails', async () => {
|
||||
vi.mocked(getFinanceFeeSource).mockRejectedValueOnce(new ApiResponseError('费用来源不可用', 'FIN-FEE-404', 404, undefined, 'req-g2-error', 'trace-g2-error'))
|
||||
const wrapper = await mountView(['platform:finance:bill:view', 'platform:finance:fee-source:view'])
|
||||
const wrapper = await mountView(['platform:finance:customer-arap:list', 'platform:finance:fee-source:view'])
|
||||
await loadRows(wrapper)
|
||||
const vm = wrapper.vm as unknown as { openDetail(row: Record<string, unknown>): Promise<void> }
|
||||
|
||||
@@ -157,7 +157,7 @@ describe('FinanceCustomerArapView G2 operations', () => {
|
||||
})
|
||||
|
||||
it('restores the independent detail route from its fee source id', async () => {
|
||||
const wrapper = await mountView(['platform:finance:bill:view'], '/finance/customer-arap/42')
|
||||
const wrapper = await mountView(['platform:finance:customer-arap:list'], '/finance/customer-arap/42')
|
||||
expect(getFinanceFeeSource).toHaveBeenCalledWith('42')
|
||||
expect(wrapper.text()).toContain('费用来源详情')
|
||||
expect(wrapper.text()).toContain('IB-91')
|
||||
@@ -165,7 +165,7 @@ describe('FinanceCustomerArapView G2 operations', () => {
|
||||
})
|
||||
|
||||
it('creates a reconciliation draft from selected eligible receivables', async () => {
|
||||
const wrapper = await mountView(['platform:finance:bill:view', 'platform:finance:reconciliation:create'])
|
||||
const wrapper = await mountView(['platform:finance:customer-arap:list', 'platform:finance:reconciliation:create'])
|
||||
await loadRows(wrapper)
|
||||
const vm = wrapper.vm as unknown as {
|
||||
selectedRows: Array<Record<string, unknown>>
|
||||
|
||||
Reference in New Issue
Block a user