优化
This commit is contained in:
@@ -5,6 +5,7 @@ import { readFile } from 'node:fs/promises'
|
||||
const source = await readFile(new URL('../api/pda-loading.js', import.meta.url), 'utf8')
|
||||
const http = await readFile(new URL('../api/http.js', import.meta.url), 'utf8')
|
||||
const page = await readFile(new URL('../pages/picking/picking.vue', import.meta.url), 'utf8')
|
||||
const styles = await readFile(new URL('../styles/pda.scss', import.meta.url), 'utf8')
|
||||
|
||||
test('sealed pallets use a single authoritative pallet command and prohibit partial picking', () => {
|
||||
assert.match(source, /pallets\/pick/)
|
||||
@@ -92,7 +93,10 @@ test('picking page exposes five evidence slots, retry and remote completion stat
|
||||
assert.match(page, /sourceType: \['camera'\]/)
|
||||
assert.doesNotMatch(page, /sourceType: \['camera', 'album'\]/)
|
||||
assert.match(page, /evidenceEntries\(slot\.type\)/)
|
||||
assert.match(page, /voidEvidencePhoto\(/)
|
||||
assert.match(page, /deleteEvidencePhoto\(/)
|
||||
assert.match(page, /class="evidence-delete-btn" aria-label="删除照片"[\s\S]*?>×<\/button>/)
|
||||
assert.doesNotMatch(page, />作废<\/button>/)
|
||||
assert.match(styles, /\.evidence-delete-btn\s*\{[^}]*width:\s*40px;[^}]*background:\s*transparent;/)
|
||||
assert.match(page, /evidenceComplete/)
|
||||
})
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ test('photos upload, bind, reload and void before picking completion', () => {
|
||||
assert.doesNotMatch(retry, /if \(!this\.loadingStageReady\)/)
|
||||
assert.match(page, /async loadLoadingEvidence\(\) \{[\s\S]*?!this\.evidenceIdentity\?\.taskId[\s\S]*?!this\.evidenceIdentity\?\.warehouseId[\s\S]*?getEvidence\(identity\.taskId, identity\.warehouseId\)/)
|
||||
assert.match(page, /await this\.loadLoadingEvidence\(\)[\s\S]*?if \(this\.loadingStageReady\) this\.activeStage = 'evidence'/)
|
||||
assert.match(page, /async voidEvidencePhoto\([^)]*\) \{[\s\S]*?if \(!this\.requireEvidenceMutation\(\)\) return/)
|
||||
assert.match(page, /async deleteEvidencePhoto\([^)]*\) \{[\s\S]*?if \(!this\.requireEvidenceMutation\(\)\) return/)
|
||||
assert.match(page, /async completeLoadingTask\([^)]*\) \{[\s\S]*?if \(!this\.requireEvidenceStage\(\)\) return/)
|
||||
assert.doesNotMatch(page, /照片已上传,拣货完成后自动保存/)
|
||||
})
|
||||
@@ -239,7 +239,7 @@ test('returning from an image preview does not refresh the picking task', () =>
|
||||
|
||||
test('evidence save, void and loading completion ignore stale cabinet responses', () => {
|
||||
for (const [method, awaitedCall] of [
|
||||
['voidEvidencePhoto', 'voidEvidence'],
|
||||
['deleteEvidencePhoto', 'voidEvidence'],
|
||||
['completeLoadingTask', 'completeContainerPickingTask']
|
||||
]) {
|
||||
const body = page.match(new RegExp(`async ${method}\\([^)]*\\) \\{[\\s\\S]*?\\n\\t\\t\\t\\},`))?.[0] || ''
|
||||
|
||||
Reference in New Issue
Block a user