26 lines
1.5 KiB
JavaScript
26 lines
1.5 KiB
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('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;/)
|
|
})
|