Files
pda-uniapp/tests/picking-location-display.test.mjs
T
2026-08-27 17:16:41 +08:00

12 lines
600 B
JavaScript

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 \}\}/)
})