fix(workbench): show single expense distribution chart

This commit is contained in:
caoxiaozhu
2026-06-03 15:46:51 +08:00
parent 18d716bc6b
commit e12b140508
6 changed files with 139 additions and 15 deletions

View File

@@ -0,0 +1,15 @@
import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
import test from 'node:test'
import { fileURLToPath } from 'node:url'
const donutChart = readFileSync(
fileURLToPath(new URL('../src/components/charts/DonutChart.vue', import.meta.url)),
'utf8'
)
test('donut chart supports hiding its built-in legend without changing the default', () => {
assert.match(donutChart, /showLegend: \{ type: Boolean, default: true \}/)
assert.match(donutChart, /v-if="showLegend" class="donut-legend"/)
assert.match(donutChart, /donut-chart--legendless/)
})

View File

@@ -17,9 +17,12 @@ test('expense stats detail modal exposes distribution, processing time and opera
assert.match(modal, /ElTag/)
assert.match(modal, /import DonutChart from '\.\.\/charts\/DonutChart\.vue'/)
assert.match(modal, /<DonutChart/)
assert.match(modal, /:show-legend="false"/)
assert.match(modal, /distributionChartItems/)
assert.match(modal, /distributionCenterValue/)
assert.match(modal, /distributionRows/)
assert.match(modal, /expense-distribution-summary-list/)
assert.match(modal, /resolveDistributionColor/)
assert.match(modal, /processingRows/)
assert.match(modal, /operationRows/)
assert.doesNotMatch(modal, /--expense-detail-percent/)