26 lines
1.3 KiB
TypeScript
26 lines
1.3 KiB
TypeScript
import { readFileSync } from 'node:fs'
|
|
import { resolve } from 'node:path'
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
const page = readFileSync(resolve(process.cwd(), 'src/modules/finance/pages/FinanceReceivableStatisticsView.vue'), 'utf8')
|
|
|
|
describe('receivable statistics page', () => {
|
|
it('renders only the approved CNY derived metrics and current-filter actions', () => {
|
|
for (const label of ['统计月份', '应收单位', '应收总额', '已收合计', '余额未收', '打印', '导出Excel']) expect(page).toContain(label)
|
|
expect(page).toContain("exportType: 'FINANCE_RECEIVABLE_STATISTICS'")
|
|
expect(page).toContain('window.print()')
|
|
expect(page).toContain('displayCustomerName(row)')
|
|
expect(page).toContain('/^客户\\s*\\d+$/.test(snapshot)')
|
|
expect(page).toContain("return masterName || '—'")
|
|
for (const excluded of ['FBA直发', 'FBA专线', '零头减免', 'USD', '>编辑<']) expect(page).not.toContain(excluded)
|
|
})
|
|
|
|
it('keeps query reset, loading, empty, error and permission states explicit', () => {
|
|
expect(page).toContain('function reset()')
|
|
expect(page).toContain('无权访问应收款统计表')
|
|
expect(page).toContain('<LoadErrorState')
|
|
expect(page).toContain('当前月份暂无应收数据')
|
|
expect(page).toContain(':loading="loading"')
|
|
})
|
|
})
|