waterFacilityPageTheme.test.mjs 992 B

12345678910111213141516171819202122
  1. import test from 'node:test'
  2. import assert from 'node:assert/strict'
  3. import fs from 'node:fs'
  4. import path from 'node:path'
  5. // 供水设施五页统一美化(spec: docs/superpowers/specs/2026-09-05-water-facility-pages-ui-unification.md)
  6. // T-A 打样页:水厂;T-B 完成后将列表扩展为全部五个页面。
  7. const facilityPages = [
  8. 'src/views/subSystem/basic/waterPlant/index.vue'
  9. ]
  10. test('water facility pages use the shared water-page shell and theme', () => {
  11. for (const page of facilityPages) {
  12. const source = fs.readFileSync(path.resolve(page), 'utf8')
  13. assert.match(source, /<div class="water-page facility-page">/u, page)
  14. assert.match(source, /@use '\.\.\/\.\.\/waterSupply\/components\/waterFacilityPageTheme\.scss'/u, page)
  15. assert.doesNotMatch(source, /<right-toolbar/u, page)
  16. assert.match(source, /class="page-heading"/u, page)
  17. assert.match(source, /class="filter-card"/u, page)
  18. assert.match(source, /class="table-card"/u, page)
  19. }
  20. })