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/ExpenseProfileDetailModal.vue', import.meta.url)), 'utf8' ) const radarChart = readFileSync( fileURLToPath(new URL('../src/components/charts/RadarChart.vue', import.meta.url)), 'utf8' ) test('expense profile modal remounts the behavior radar when opened', () => { assert.match(modal, /destroy-on-close/) assert.match(modal, / props\.visible[\s\S]*radarRenderKey\.value \+= 1/) assert.match(modal, /scheduleRadarFrame/) }) test('radar chart uses the shared echarts lifecycle and enables entrance animation', () => { assert.match(radarChart, /import \{ useEcharts \} from '\.\.\/\.\.\/composables\/useEcharts\.js'/) assert.match(radarChart, /useEcharts\(chartElement, chartOptions\)/) assert.match(radarChart, /animation: true/) assert.match(radarChart, /animationDuration: 980/) assert.match(radarChart, /animationDurationUpdate: 760/) assert.match(radarChart, /animationEasing: 'cubicOut'/) assert.doesNotMatch(radarChart, /import \{[^}]*init[^}]*\} from 'echarts\/core'/) })