Files
shanxia2.0/web-admin/scripts/issue-26-fold-icon-and-archive-plan-no.test.ts
T
wuzilongandCursor 8bffb1cbf5 fix(web-admin): restore fold icon in production and toggle archive planNo.
Remove Tailwind inline from el-icon so production CSS no longer collapses the header fold control, and expose 计划编号 in the plan-archive column picker.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-14 21:10:15 +08:00

37 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* #26 回归:
* 1) ArtSvgIcon 的 el-icon 不得带 Tailwind `inline`(生产 CSS 会覆盖 display)
* 2) 运输归档列展示含 planNo,且表格列受 isColumnVisible 控制
*/
import test from 'node:test'
import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { parse } from '@vue/compiler-sfc'
const root = join(dirname(fileURLToPath(import.meta.url)), '..')
test('ArtSvgIcon: el-icon branch must not use Tailwind inline class', () => {
const src = readFileSync(join(root, 'src/components/core/base/art-svg-icon/index.vue'), 'utf8')
const { descriptor } = parse(src)
const template = descriptor.template?.content || ''
assert.match(template, /<el-icon\b[^>]*class="[^"]*art-svg-icon/)
assert.doesNotMatch(
template,
/<el-icon\b[^>]*class="[^"]*\binline\b/,
'el-icon must not include Tailwind inline (breaks display:inline-flex in prod CSS order)'
)
})
test('plan-archive: planNo is in column defs and table visibility gate', () => {
const src = readFileSync(join(root, 'src/views/pl/plan-archive/index.vue'), 'utf8')
assert.match(src, /prop:\s*'planNo',\s*label:\s*'计划编号'/)
assert.match(src, /pl-plan-archive-list-columns-v17/)
assert.match(
src,
/v-if="isColumnVisible\('planNo'\)"[\s\S]*?prop="planNo"/,
'planNo table column must be gated by isColumnVisible'
)
})