import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' import test from 'node:test' const pagePath = 'src/views/subSystem/waterSupply/components/WaterDevicePage.vue' /** 找到 marker 所在标签上离它最近的 v-if 条件,用于校验列/区块的视图可见性 */ function conditionOf(source, marker) { const at = source.indexOf(marker) if (at < 0) return null const before = source.slice(0, at) const start = before.lastIndexOf('v-if="') if (start < 0) return null const end = source.indexOf('"', start + 'v-if="'.length) return source.slice(start + 'v-if="'.length, end) } test('abnormal board shows the district column so the region filter is verifiable', async () => { const source = await readFile(pagePath, 'utf8') assert.match( source, /label="所属区域"[^>]*>\s*