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"/)
|
})
|