relationDetailWiring.test.js 922 B

123456789101112131415
  1. /** 详情面板中关联事件/工单的「查看详情」必须一路接到外壳。 */
  2. import assert from 'node:assert/strict'
  3. import { readFileSync } from 'node:fs'
  4. import { test } from 'node:test'
  5. const shell = readFileSync(new URL('../src/modules/cockpit/CockpitShell.vue', import.meta.url), 'utf8')
  6. const drawer = readFileSync(new URL('../src/modules/cockpit/components/EntityDetailDrawer.vue', import.meta.url), 'utf8')
  7. const sections = readFileSync(new URL('../src/modules/cockpit/components/EntityDetailSections.vue', import.meta.url), 'utf8')
  8. test('详情抽屉的关联打开事件没有在改版中被丢掉', () => {
  9. assert.match(sections, /@click\.stop="openRelation\(item\)"/)
  10. assert.match(drawer, /@open-relation="\(item\) => emit\('open-relation', item\)"/)
  11. assert.match(shell, /@open-relation="openRelationFromDetail"/)
  12. assert.match(shell, /function openRelationFromDetail\(item\)/)
  13. })