This commit is contained in:
2026-08-15 12:33:33 +08:00
parent 03734c8f25
commit 207c872dff
4 changed files with 105 additions and 5 deletions
+11
View File
@@ -67,6 +67,17 @@ test('PDA evidence binding unwraps the nested loading action response before ren
assert.match(page, /cacheEvidencePreview\(current\.fileId, current\.localPath/)
})
test('PDA downloads authenticated evidence previews returned by the backend', () => {
assert.match(source, /export function getEvidencePreviewUrl\(inboundId, evidenceId, tenantId\)/)
assert.match(source, /loading\/evidence\/\$\{encodeURIComponent\(evidenceId\)\}\/content\/pda\?tenantId=/)
assert.match(source, /export function downloadEvidencePreview\(previewUrl\)/)
assert.match(source, /uni\.downloadFile\(/)
assert.match(source, /headers\.Authorization = `Bearer \$\{session\.token\}`/)
assert.match(source, /response\.tempFilePath/)
assert.match(source, /evidence\.preview\.response/)
assert.match(source, /\^image\\\//)
})
test('PDA cabinet picking adapter claims online and submits one atomic batch', () => {
assert.match(source, /\/first-leg\/pda-loading\/tasks\/pending/)
assert.match(source, /\/first-leg\/pda-loading\/tasks\?/)
+6 -2
View File
@@ -74,10 +74,14 @@ test('refresh preserves local photos for the same evidence identity and flushes
test('evidence photos render thumbnails and support full-screen preview', () => {
assert.match(page, /class="evidence-thumbnail" :src="evidencePreviewSource\(photo\)"/)
assert.match(page, /@tap="previewEvidencePhoto\(photo, slot\.type\)"/)
assert.match(page, /evidencePreviewSource\(photo\)[\s\S]*?localPath[\s\S]*?previewUrl[\s\S]*?fileUrl/)
assert.match(page, /evidencePreviewSource\(photo\)[\s\S]*?localPath[\s\S]*?fileUrl/)
assert.match(page, /previewEvidencePhoto\(photo, type\)[\s\S]*?uni\.previewImage\([\s\S]*?current[\s\S]*?urls/)
assert.match(page, /cacheEvidencePreview\(fileId, localPath/)
assert.match(page, /withCachedEvidencePreview\(photo[\s\S]*?evidencePreviewCache/)
assert.match(page, /item\.previewUrl \|\| getEvidencePreviewUrl\(identity\.inboundId, item\.id, this\.currentBox\.tenantId\)/)
assert.match(page, /['"]list\.loaded['"]/)
assert.match(page, /loadEvidencePreviews\(contextId, identity\)[\s\S]*?downloadEvidencePreview\(item\.previewUrl\)/)
assert.match(page, /['"]preview\.downloaded['"]/)
assert.match(page, /已上传并保存/)
})
@@ -90,7 +94,7 @@ test('switching cabinets invalidates old sync and evidence upload state', () =>
assert.match(selector, /this\.resetEvidenceState\(\)/)
assert.match(page, /!this\.isEvidenceContextActive\(contextId, identity\) \|\| queue !== this\.evidenceQueue/)
const loader = page.match(/async loadLoadingEvidence\(\) \{[\s\S]*?\n\t\t\t\},/)?.[0] || ''
assert.equal((loader.match(/isEvidenceContextActive\(contextId, identity\)/g) || []).length, 2)
assert.ok((loader.match(/isEvidenceContextActive\(contextId, identity\)/g) || []).length >= 2)
})
test('camera callbacks cannot append evidence after switching cabinets', () => {