import test from 'node:test' import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' const homePath = 'src/views/subSystem/waterSupply/components/WaterSupplyHome.vue' test('home removes the A/B/C placeholder headings', async () => { const source = await readFile(homePath, 'utf8') assert.doesNotMatch(source, /A · 指挥台/u) assert.doesNotMatch(source, /B · 异常待办/u) assert.doesNotMatch(source, /C · 数据总览/u) }) test('home realtime alarms split between audit and work order by display status', async () => { const source = await readFile(homePath, 'utf8') assert.match(source, /openRealtimeAlarm\(item\)/u) assert.match(source, /realtimeAlarmJumpTarget\(item\)/u) assert.match(source, /goPage\(target\.path, target\.query\)/u) assert.match(source, /item\.displayStatusText/u) assert.match(source, /item\.displayStatusType/u) assert.match(source, /goPage\('\/device\/maintain'/u) }) test('home overview uses the shared GIS map canvas and aggregates all one-map layers', async () => { const source = await readFile(homePath, 'utf8') assert.match(source, / { const source = await readFile(homePath, 'utf8') assert.match(source, /grid-template-columns:\s*minmax\(240px,\s*1fr\)\s+minmax\(0,\s*3fr\)\s+minmax\(240px,\s*1fr\)/u) }) test('home work order jumps point to device maintenance dispatch page', async () => { const source = await readFile(homePath, 'utf8') const jumps = source.match(/goPage\('\/device\/maintain'/gu) || [] assert.ok(jumps.length >= 3, 'header, work order rows and related order should all route to device maintain') assert.doesNotMatch(source, /monitorAlarm\/workOrder/u) assert.match(source, />设备维修派单<\/el-button>/u) })