优化
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { http } from '@/shared/api/http'
|
||||
import { downloadInboundCartonLabels, downloadPlatformInboundHoldEvidence, getPlatformInbound, getPlatformInboundHold, holdPlatformInbound, listPlatformInbounds, releasePlatformInbound, uploadPlatformInboundHoldEvidence } from './api'
|
||||
import { downloadInboundCartonLabels, downloadInboundCartonLabelsBatch, downloadPlatformInboundHoldEvidence, getPlatformInbound, getPlatformInboundHold, holdPlatformInbound, listPlatformInbounds, releasePlatformInbound, uploadPlatformInboundHoldEvidence } from './api'
|
||||
|
||||
vi.mock('@/shared/api/http', () => ({
|
||||
ApiResponseError: class ApiResponseError extends Error {
|
||||
@@ -117,6 +117,20 @@ describe('platform inbound query API', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('downloads one PDF for a cross-customer batch of inbound orders', async () => {
|
||||
const pdf = new Blob(['pdf'], { type: 'application/pdf' })
|
||||
vi.mocked(http.post).mockResolvedValueOnce(pdf)
|
||||
const items = [
|
||||
{ tenantId: '10001', inboundId: '19001' },
|
||||
{ tenantId: '10002', inboundId: '19002' },
|
||||
]
|
||||
|
||||
await expect(downloadInboundCartonLabelsBatch(items)).resolves.toBe(pdf)
|
||||
expect(http.post).toHaveBeenCalledWith('/platform/inbounds/carton-label-pdf', items, {
|
||||
responseType: 'blob', timeout: 120_000,
|
||||
})
|
||||
})
|
||||
|
||||
it('loads and normalizes the tenant-scoped hold state and immutable history', async () => {
|
||||
vi.mocked(http.get).mockResolvedValue({ data: {
|
||||
inboundId: 19001, tenantId: 10002, holdFlag: true, currentHoldReason: ' 待核对货款 ', version: '4',
|
||||
|
||||
Reference in New Issue
Block a user