This commit is contained in:
2026-08-27 17:16:41 +08:00
parent b1f46835b2
commit 431f3f2f92
5 changed files with 99 additions and 42 deletions
+25
View File
@@ -0,0 +1,25 @@
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('partial picking uses a compact quantity panel with four equal quick choices', async () => {
const [page, styles] = await Promise.all([
read('../pages/picking/picking.vue'),
read('../styles/pda.scss')
])
assert.match(page, /partial-info-copy[\s\S]*?partial-info-qty-number/)
assert.match(page, /partial-input-label">实际拣出数量[\s\S]*?partial-input-control/)
assert.match(page, /placeholder="请输入数量"/)
assert.match(page, /placeholder-class="partial-input-placeholder"/)
assert.match(page, /partial-quick-btn"[\s\S]*?:class="\{ selected: String\(partialInput\) === String\(option\.value\) \}"/)
assert.match(page, /partial-quick-ratio[\s\S]*?partial-quick-value/)
assert.match(styles, /\.partial-quick-row \{[^}]*grid-template-columns: repeat\(4, minmax\(0, 1fr\)\)[^}]*align-items: stretch/)
assert.match(styles, /\.partial-quick-btn \{[^}]*width: 100%;[^}]*height: 48px;[^}]*margin: 0;/)
assert.match(styles, /\.partial-input-control \{[^}]*height: 50px;[^}]*border: 2px solid \$primary/)
assert.match(styles, /\.partial-input-placeholder \{[^}]*font-size: 14px;[^}]*font-weight: 400;/)
assert.match(styles, /\.partial-modal \.modal-actions \{[^}]*margin-top: 12px/)
assert.match(styles, /\.partial-modal \.modal-cancel-btn, \.partial-modal \.modal-confirm-btn \{[^}]*width: 100%;[^}]*margin: 0;/)
})
+11
View File
@@ -0,0 +1,11 @@
import test from 'node:test'
import assert from 'node:assert/strict'
import { readFile } from 'node:fs/promises'
const page = await readFile(new URL('../pages/picking/picking.vue', import.meta.url), 'utf8')
test('missing picking location does not render an empty badge or dangling separator', () => {
assert.match(page, /<text v-if="item\.location" class="pick-item-location">\{\{ item\.location \}\}<\/text>/)
assert.match(page, /item\.location \? `\$\{item\.sku\} · \$\{item\.location\}` : item\.sku/)
assert.doesNotMatch(page, /<text class="pick-item-location">\{\{ item\.location \}\}/)
})