fix(admin): complete container loading workflows

This commit is contained in:
2026-08-11 11:15:44 +08:00
parent 76f5a1debf
commit 9b994040b8
13 changed files with 456 additions and 135 deletions
@@ -6,6 +6,7 @@ import {
completeLoading,
confirmingPreload,
deleteSmartLoadingItem,
downloadEvidenceFile,
getContainerBooking,
getOutboundDispatch,
getPicking,
@@ -86,6 +87,13 @@ describe('unified order workflow API contract', () => {
)
})
it('downloads loading evidence through the tenant and inbound scoped file endpoint', async () => {
const blob = new Blob(['photo'], { type: 'image/jpeg' })
vi.mocked(http.get).mockResolvedValue(blob)
await expect(downloadEvidenceFile('2', '8', '88')).resolves.toBe(blob)
expect(http.get).toHaveBeenCalledWith('/platform/v1/files/loading-evidence/2/8/88', { responseType: 'blob' })
})
it('normalizes smart-loading long identifiers as strings', async () => {
vi.mocked(http.get)
.mockResolvedValueOnce({ data: { id: '2086085512165634050', warehouseId: '2086085512165634051', capacityCbm: '68', maxWeightKg: '25000', version: 2 } })