import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import test from 'node:test' import { fileURLToPath } from 'node:url' import { departmentRangeOptions } from '../src/data/metrics.js' const overviewView = readFileSync( fileURLToPath(new URL('../src/views/OverviewView.vue', import.meta.url)), 'utf8' ) const overviewViewModel = readFileSync( fileURLToPath(new URL('../src/composables/useOverviewView.js', import.meta.url)), 'utf8' ) const analyticsService = readFileSync( fileURLToPath(new URL('../src/services/analytics.js', import.meta.url)), 'utf8' ) const barChart = readFileSync( fileURLToPath(new URL('../src/components/charts/BarChart.vue', import.meta.url)), 'utf8' ) test('finance dashboard ranking range options support month quarter year and all', () => { assert.deepEqual(departmentRangeOptions, ['本月', '本季度', '本年', '全部']) assert.match(analyticsService, /department_employee_mix/) assert.match(analyticsService, /departmentEmployeeMix/) assert.match(analyticsService, /department_range/) }) test('finance dashboard renders shared ranking filters and department employee mix chart', () => { assert.match(overviewView, /