This commit is contained in:
2026-09-14 17:54:21 +08:00
parent 7e1b9b4cee
commit 25825685c3
40 changed files with 850 additions and 705 deletions
@@ -115,22 +115,24 @@ async function loadRows(wrapper: VueWrapper, warehouseId = '') {
enableAutoUnmount(afterEach)
afterAll(() => vi.unstubAllGlobals())
const densitySource = readFileSync(resolve(process.cwd(), 'src/styles/adminDensity.css'), 'utf8')
describe('PalletsView', () => {
it('uses bordered striped tables and explicit semantic row actions', () => {
expect(palletsSource).toContain('border')
expect(palletsSource).toContain('stripe')
expect(palletsSource).toContain('size="small" plain type="primary"')
expect(palletsSource).toMatch(/size="small"\s+plain\s+type="danger"/)
expect(palletsSource).toContain('class="density-action" size="small" title="编辑托盘"')
expect(palletsSource).toContain('class="density-action" data-tone="danger"')
expect(palletsSource).not.toContain('<Eye :size="15" />')
expect(palletsSource).toContain('<Pencil :size="15" />')
expect(palletsSource).toContain('<Trash2 :size="15" />')
expect(palletsSource).not.toContain('<Pencil :size="15" />')
expect(palletsSource).not.toContain('<Trash2 :size="15" />')
expect(palletsSource).toContain('@media (max-width: 720px)')
})
it('uses the prototype-sized centered editor without an extra detail drawer', () => {
expect(palletsSource).not.toContain('<AppDrawer')
expect(palletsSource).toContain('<AppDialog v-model="editorOpen" :title="editorTitle" width="min(560px, calc(100vw - 28px))"')
expect(palletsSource).not.toContain('<el-drawer v-model="editorOpen"')
expect(palletsSource).toContain(':global(.pallet-editor-dialog .el-dialog__body) { min-height: 0; overflow-y: auto; }')
expect(densitySource).toContain('.admin-density-dialog.el-dialog .el-dialog__body { min-height: 0; overflow-y: auto;')
expect(palletsSource).toContain('.editor-field-grid { grid-template-columns: minmax(0, 1fr); }')
})
beforeEach(() => {