This commit is contained in:
2026-08-14 17:38:06 +08:00
parent d1b4a4d3f3
commit 010204da57
12 changed files with 259 additions and 33 deletions
@@ -16,6 +16,8 @@ describe('WeightOcrPanel contract', () => {
it('covers upload, immediate preview, inline correction, deletion, confirmation, and server totals', () => {
expect(source).toContain('uploadWeightImage')
expect(source).toContain('getWeightPalletOptions')
expect(source).toContain('palletId: selectedPalletId.value')
expect(source).toContain('downloadWeightImage')
expect(source).toContain('await openPreview(created, URL.createObjectURL(file))')
expect(source).toContain('previewShowsRecognition.value = Boolean(localUrl)')
@@ -26,7 +28,9 @@ describe('WeightOcrPanel contract', () => {
expect(source).toContain('识别重量')
expect(source).toContain('payload.adjustedWeightValue = Number(draft.value)')
expect(source).toContain('payload.adjustmentReason = buildAdjustmentReason(row)')
expect(source).toContain('已确认总毛重')
expect(source).toContain('货物总重量')
expect(source).toContain('palletTareWeightKg')
expect(source).toContain('netWeightKg')
expect(source).toContain("emit('summaryChanged', workspace.value?.actualGrossWeightKg ?? null)")
})
@@ -53,6 +57,7 @@ describe('WeightOcrPanel contract', () => {
expect(source).toContain('<LoadErrorState')
expect(source).toContain('尚未上传称重图片')
expect(source).toContain('v-loading="loading"')
expect(source).toContain('@media (max-width: 720px)')
expect(source).toContain('@media (max-width: 360px)')
})
})