This commit is contained in:
2026-08-12 09:26:00 +08:00
parent 64a8fcd130
commit 0b51ed4347
5 changed files with 32 additions and 17 deletions
+8 -4
View File
@@ -102,12 +102,16 @@ test('picking page keeps scan, draft and risky transition contracts', async () =
assert.match(page, /submitStatusHint\(\)[\s\S]*?提交时需选择原因/)
assert.match(page, /onBackPress\(\)/)
assert.doesNotMatch(page, /scanFocused|restoreScanFocus|hideKeyboard|@confirm="handleScan"/)
assert.match(page, /<ScanTargetInput v-model="scanValue" name="sku"[\s\S]*?:active="activeScanField === 'sku'"[\s\S]*?@activate="setScanTarget"[\s\S]*?@submit="handleManualSubmit"/)
assert.match(page, /<ScanTargetInput v-model="scanValue" name="boxCode"[\s\S]*?:active="activeScanField === 'boxCode'"[\s\S]*?@activate="setScanTarget"[\s\S]*?@submit="handleManualSubmit"/)
assert.match(page, /beforeUnmount\(\)/)
assert.match(page, /startScanBroadcast/)
assert.match(page, /onHide\(\) \{ this\.stopHardwareScanner\(\) \}/)
assert.match(page, /handleHardwareScan\(value\)[\s\S]*?this\.scanValue = value[\s\S]*?this\.processScannedValue\(value, 'broadcast'\)/)
assert.match(page, /handleManualSubmit\(value\)[\s\S]*?\.trim\(\)\.toUpperCase\(\)[\s\S]*?this\.processScannedValue\(normalizedValue, 'manual'\)/)
assert.match(page, /recordScanResult\(type, title, boxCode, detail\)/)
assert.match(page, /lastScanResult\.boxCode/)
assert.match(page, /boxCode: entry\.boxCode \?\? entry\.sku \?\? ''/)
assert.doesNotMatch(page, /lastScanResult\.sku|entry\.sku\s*}}/)
const processScanMethod = page.match(/processScannedValue\(scanValue, source = 'broadcast'\) \{[\s\S]*?\n\t\t\t\},\n\t\t\tpickItem/)
assert.ok(processScanMethod)
assert.doesNotMatch(processScanMethod[0], /this\.scanValue = ''/)
@@ -198,7 +202,7 @@ test('picking scan results use the shared success and error audio feedback', asy
assert.match(audio, /export function playErrorSound\(\)/)
assert.match(picking, /import \{ playErrorSound, playSuccessSound \} from '@\/utils\/audio-feedback\.js'/)
assert.match(picking, /result\.type === 'unknown'[\s\S]*?playErrorSound\(\)/)
assert.match(picking, /playSuccessSound\(\)[\s\S]*?this\.pickItem\(result\.item\.id, 'scan'\)/)
assert.match(picking, /playSuccessSound\(\)[\s\S]*?this\.pickScannedBox\(result\.item, value\)/)
})
test('reusable scan target input separates field selection from page-level broadcast handling', async () => {
@@ -209,8 +213,8 @@ test('reusable scan target input separates field selection from page-level broad
assert.match(component, /<input[\s\S]*?:value="modelValue"[\s\S]*?@input="handleInput"[\s\S]*?@confirm="handleConfirm"/)
assert.doesNotMatch(component, /<input[\s\S]*?disabled/)
assert.doesNotMatch(component, /startScanBroadcast|plus\.android/)
assert.match(picking, /activeScanField: 'sku'/)
assert.match(picking, /handleHardwareScan\(value\)[\s\S]*?activeScanField !== 'sku'[\s\S]*?processScannedValue\(value, 'broadcast'\)/)
assert.match(picking, /activeScanField: 'boxCode'/)
assert.match(picking, /handleHardwareScan\(value\)[\s\S]*?activeScanField !== 'boxCode'[\s\S]*?processScannedValue\(value, 'broadcast'\)/)
})
test('picking session persists per task identity and clears on logout', async () => {