import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' import test from 'node:test' test('the water alarm management menu resolves to the shared alarm list (scoped by query.rootTypeId)', async () => { const { resolveAlarmMenuView } = await import('../src/router/alarmMenuView.js') assert.equal(resolveAlarmMenuView('subSystem/alarm/common/list', '{"rootTypeId":1}'), 'subSystem/alarm/common/list') assert.equal(resolveAlarmMenuView('subSystem/alarm/common/list', '{"rootTypeId":2}'), 'subSystem/alarm/common/list') }) test('water alarm detail offers audit and related work-order shortcuts without changing other systems', async () => { const detail = await readFile('src/views/subSystem/alarm/AlarmDetail.vue', 'utf8') assert.match(detail, /waterShortcuts/u) assert.match(detail, /goWaterWorkOrder/u) assert.match(detail, /navigate\('alarmAudit'/u) }) test('water menu resolver is wired into dynamic route loading', async () => { const source = await readFile('src/store/modules/permission.js', 'utf8') assert.match(source, /loadView\(resolveAlarmMenuView\(route.component, route.query\)\)/u) }) test('misreport remains distinct and the detail shortcut targets a searchable work order', async () => { const detail = await readFile('src/views/subSystem/alarm/AlarmDetail.vue', 'utf8') assert.match(detail, /keyword: alarm.value.orderNo/u) assert.ok(detail.includes('min(680px, 100vw)')) })