zhou zhou
12 小时以前 40905cbd04c2e332cd4bc2b9e0c5b3e1da9cccfa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import assert from 'node:assert/strict'
import fs from 'node:fs'
import path from 'node:path'
import test from 'node:test'
import { fileURLToPath } from 'node:url'
 
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const projectRoot = path.resolve(__dirname, '..')
const workTabSource = fs.readFileSync(
  path.join(projectRoot, 'src/components/core/layouts/art-work-tab/index.vue'),
  'utf8'
)
 
test('work tabs only render the leading icon when a tab actually has an icon', () => {
  assert.match(workTabSource, /<ArtSvgIcon\s+v-if="item\.icon"/)
  assert.doesNotMatch(workTabSource, /<ArtSvgIcon\s+v-show="item\.icon"/)
})