fix(workbench): show single expense distribution chart
This commit is contained in:
15
web/tests/donut-chart.test.mjs
Normal file
15
web/tests/donut-chart.test.mjs
Normal 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/)
|
||||
})
|
||||
@@ -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/)
|
||||
|
||||
Reference in New Issue
Block a user