| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import test from 'node:test'
- import assert from 'node:assert/strict'
- import { readFile } from 'node:fs/promises'
- test('device gis page is a dedicated map at the public route seam', async () => {
- const apiSource = await readFile('src/api/pipeNetwork/waterSupply.js', 'utf8')
- const entrySource = await readFile('src/views/subSystem/waterSupply/device/gis.vue', 'utf8')
- assert.match(apiSource, /export const getDeviceGisAllPoints = \(\) => get\('\/waterSupply\/device\/gis\/allPoints'\)/u)
- assert.match(apiSource, /export const getDeviceGisAbnormalPoints = \(\) => get\('\/waterSupply\/device\/gis\/abnormalPoints'\)/u)
- assert.match(apiSource, /export const getDeviceGisStatistics = \(\) => get\('\/waterSupply\/device\/gis\/statistics'\)/u)
- assert.match(apiSource, /export const getDeviceGisDetail = \(id\) => get\(`\/waterSupply\/device\/gis\/detail\/\$\{id\}`\)/u)
- assert.match(entrySource, /import WaterDeviceGisMap from '\.\.\/components\/WaterDeviceGisMap\.vue'/u)
- assert.doesNotMatch(entrySource, /WaterDevicePage/)
- })
- test('device gis map exposes water filtering, exception highlight and detail behavior', async () => {
- const source = await readFile(
- 'src/views/subSystem/waterSupply/components/WaterDeviceGisMap.vue',
- 'utf8'
- )
- assert.match(source, /getDeviceGisAllPoints/u)
- assert.match(source, /getDeviceGisAbnormalPoints/u)
- assert.match(source, /getDeviceGisStatistics/u)
- assert.match(source, /getDeviceGisDetail/u)
- assert.match(source, /equipmentTypeId/u)
- assert.match(source, /设备类型/u)
- assert.match(source, /searchKeyword/u)
- assert.match(source, /搜索设备/u)
- assert.match(source, /图例/u)
- assert.match(source, /报警/u)
- assert.match(source, /维修/u)
- assert.match(source, /离线/u)
- assert.match(source, /正常/u)
- assert.match(source, /<GisMapCanvas/u)
- assert.match(source, /:points="mapPoints"/u)
- assert.match(source, /el-drawer/u)
- assert.match(source, /设备详情/u)
- assert.match(source, /v-loading/u)
- assert.match(source, /暂无可显示的监测设备/u)
- assert.match(source, /重试/u)
- assert.match(source, /刷新/u)
- })
- test('device gis map separates status sources in detail text', async () => {
- const source = await readFile(
- 'src/views/subSystem/waterSupply/components/WaterDeviceGisMap.vue',
- 'utf8'
- )
- assert.match(source, /设备状态/u)
- assert.match(source, /在线状态/u)
- assert.match(source, /报警状态/u)
- assert.match(source, /报警等级/u)
- assert.match(source, /异常原因/u)
- assert.match(source, /最新数据/u)
- assert.match(source, /维修记录/u)
- assert.match(source, /selectedDetail\.longitude/u)
- assert.match(source, /selectedDetail\.latitude/u)
- })
|