Files
pda-uniapp/tests/evidence-layout.test.mjs
T
2026-08-27 14:30:26 +08:00

22 lines
966 B
JavaScript

import test from 'node:test'
import assert from 'node:assert/strict'
import { readFile } from 'node:fs/promises'
const read = (path) => readFile(new URL(path, import.meta.url), 'utf8')
test('empty evidence slots stay compact and completed slots expand with photos', async () => {
const [page, styles] = await Promise.all([
read('../pages/picking/picking.vue'),
read('../styles/pda.scss')
])
assert.match(page, /每类至少 1 张,拍照后自动上传,可继续追加/)
assert.match(page, /v-for="\(slot, slotIndex\) in evidenceSlots"/)
assert.match(page, /class="evidence-step"[\s\S]*?slotIndex \+ 1/)
assert.match(page, /evidenceEntries\(slot\.type\)\.length \? '✓'/)
assert.doesNotMatch(page, /class="evidence-empty-hint"/)
assert.match(styles, /\.evidence-card-header \{[^}]*min-height: 44px/)
assert.match(styles, /\.evidence-add-btn \{[^}]*min-height: 42px/)
assert.match(styles, /\.evidence-photo-grid \{[^}]*grid-template-columns/)
})