优化
This commit is contained in:
@@ -114,6 +114,21 @@ describe('FinanceCustomerArapView G2 operations', () => {
|
||||
expect(editFinanceFeeSource).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('treats inbound and container fee types as Firstleg sources when sourceSystem is missing', async () => {
|
||||
const legacyFirstleg = { ...feeSummary, sourceSystem: '', sourceType: 'CONTAINER_FEE', reviewStatus: 'APPROVED' as const }
|
||||
vi.mocked(listFinanceFeeSources).mockResolvedValue({ records: [legacyFirstleg], 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('编辑')
|
||||
expect(buttonLabels).not.toContain('调整')
|
||||
const vm = wrapper.vm as unknown as { openMutation(row: Record<string, unknown>, mode: 'ADJUST'): Promise<void> }
|
||||
await vm.openMutation(legacyFirstleg as unknown as Record<string, unknown>, 'ADJUST')
|
||||
expect(getFinanceFeeSource).not.toHaveBeenCalled()
|
||||
expect(adjustFinanceFeeSource).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 }))
|
||||
@@ -209,8 +224,9 @@ describe('FinanceCustomerArapView G2 operations', () => {
|
||||
expect(page).toContain('<el-button v-if="canViewSource" size="small" plain type="primary" @click="openDetail(row)"><Eye :size="15" />详情</el-button>')
|
||||
expect(page).toContain("@click=\"openMutation(row, 'SUBMIT')\"")
|
||||
expect(page).toContain("@click=\"openMutation(row, 'ADJUST')\"")
|
||||
expect(page).toContain("row.sourceSystem !== 'FIRSTLEG'")
|
||||
expect(page).toContain("detail.sourceSystem !== 'FIRSTLEG'")
|
||||
expect(page).toContain('!isFirstlegSource(row)')
|
||||
expect(page).toContain('!isFirstlegSource(detail)')
|
||||
expect(page).toContain("['INBOUND_FEE', 'CONTAINER_FEE'].includes(type)")
|
||||
expect(page).not.toMatch(/<template #actions[\s\S]*?<el-button[^>]*\blink\b/)
|
||||
expect(page).toContain('white-space: nowrap')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user