import assert from 'node:assert/strict';
import { readFile } from 'node:fs/promises';
import test from 'node:test';
const [app, index, styles, taskService, server] = await Promise.all([
readFile(new URL('./app.js', import.meta.url), 'utf8'),
readFile(new URL('./index.html', import.meta.url), 'utf8'),
readFile(new URL('./styles.css', import.meta.url), 'utf8'),
readFile(new URL('../control-plane/src/task-service.ts', import.meta.url), 'utf8'),
readFile(new URL('../control-plane/src/server.ts', import.meta.url), 'utf8')
]);
test('dashboard summary cards are uniform display-only totals and leave filtering to the explicit controls', () => {
const summaryRenderer = app.slice(
app.indexOf('function renderOperationsDashboardSummary()'),
app.indexOf('function operationsDashboardRankScale')
);
assert.match(app, /label: '操作次数'[^\n]+tone: 'total'/);
assert.doesNotMatch(app, /tone: 'primary'/);
assert.match(summaryRenderer, /const card = el\('article', `operations-dashboard-stat operations-dashboard-stat-\$\{item\.tone\}`\)/);
assert.doesNotMatch(summaryRenderer, /selectedStatus|isSelected|operationsStatus|aria-pressed/);
assert.doesNotMatch(app, /\$\('#operationsDashboardSummary'\)\?\.addEventListener\('click'/);
assert.match(index, /