Refocus dashboard on device monitoring
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import test from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { readFile } from 'node:fs/promises'
|
||||
|
||||
const root = new URL('../', import.meta.url)
|
||||
|
||||
async function text(path) {
|
||||
return readFile(new URL(path, root), 'utf8')
|
||||
}
|
||||
|
||||
test('dashboard primary surface is a device monitoring board, not an API catalog', async () => {
|
||||
const html = await text('public/index.html')
|
||||
const app = await text('public/app.js')
|
||||
|
||||
assert.match(html, /设备监控|设备详情|实时状态/)
|
||||
assert.match(app, /renderDeviceDetails/)
|
||||
assert.match(app, /温度/)
|
||||
assert.match(app, /流量|速率/)
|
||||
assert.match(app, /内存|磁盘/)
|
||||
assert.match(app, /SIM|ICCID/)
|
||||
assert.match(app, /短信/)
|
||||
|
||||
const dashboardBlock = html.match(/<section id="dashboardView"[\s\S]*?<\/section>\s*<section id="apiView"/)
|
||||
assert.ok(dashboardBlock, 'dashboardView block should exist before apiView')
|
||||
assert.doesNotMatch(dashboardBlock[0], /API 地图|endpointList|接口路径/)
|
||||
})
|
||||
Reference in New Issue
Block a user