2026-06-03 14:59:55 +08:00
|
|
|
import assert from 'node:assert/strict'
|
|
|
|
|
import { readFileSync } from 'node:fs'
|
|
|
|
|
import test from 'node:test'
|
|
|
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
|
|
|
|
|
|
const modal = readFileSync(
|
|
|
|
|
fileURLToPath(new URL('../src/components/business/ExpenseStatsDetailModal.vue', import.meta.url)),
|
|
|
|
|
'utf8'
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
test('expense stats detail modal exposes distribution, processing time and operation detail sections', () => {
|
|
|
|
|
assert.match(modal, /Expense Operation Details/)
|
|
|
|
|
assert.match(modal, /历史报销费用分布/)
|
|
|
|
|
assert.match(modal, /单据处理时间/)
|
|
|
|
|
assert.match(modal, /系统操作详情/)
|
|
|
|
|
assert.match(modal, /ElDialog/)
|
2026-06-03 17:22:48 +08:00
|
|
|
assert.match(modal, /destroy-on-close/)
|
2026-06-03 14:59:55 +08:00
|
|
|
assert.match(modal, /ElTag/)
|
2026-06-03 15:31:09 +08:00
|
|
|
assert.match(modal, /import DonutChart from '\.\.\/charts\/DonutChart\.vue'/)
|
|
|
|
|
assert.match(modal, /<DonutChart/)
|
2026-06-03 17:22:48 +08:00
|
|
|
assert.match(modal, /:key="distributionChartRenderKey"/)
|
2026-06-03 15:46:51 +08:00
|
|
|
assert.match(modal, /:show-legend="false"/)
|
2026-06-03 15:31:09 +08:00
|
|
|
assert.match(modal, /distributionChartItems/)
|
|
|
|
|
assert.match(modal, /distributionCenterValue/)
|
2026-06-03 17:22:48 +08:00
|
|
|
assert.match(modal, /const chartRenderSeq = ref\(0\)/)
|
|
|
|
|
assert.match(modal, /const distributionChartRenderKey = computed\(\(\) => `expense-distribution-\$\{chartRenderSeq\.value\}`\)/)
|
|
|
|
|
assert.match(modal, /watch\([\s\S]*\(\) => props\.visible[\s\S]*chartRenderSeq\.value \+= 1/)
|
2026-06-03 14:59:55 +08:00
|
|
|
assert.match(modal, /distributionRows/)
|
2026-06-03 15:46:51 +08:00
|
|
|
assert.match(modal, /expense-distribution-summary-list/)
|
|
|
|
|
assert.match(modal, /resolveDistributionColor/)
|
2026-06-03 14:59:55 +08:00
|
|
|
assert.match(modal, /processingRows/)
|
|
|
|
|
assert.match(modal, /operationRows/)
|
2026-06-03 15:31:09 +08:00
|
|
|
assert.doesNotMatch(modal, /--expense-detail-percent/)
|
|
|
|
|
assert.doesNotMatch(modal, /expense-distribution-track/)
|
2026-06-03 14:59:55 +08:00
|
|
|
assert.match(modal, /统计口径来自当前工作台已加载的个人单据/)
|
|
|
|
|
})
|