feat: add desktop dropship pallet printing
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, downloadInboundCartonLabelsBatch, downloadPlatformInboundHoldEvidence, getPlatformInbound, getPlatformInboundHold, holdPlatformInbound, listPlatformInboundDropshipPallets, listPlatformInbounds, releasePlatformInbound, uploadPlatformInboundHoldEvidence } from './api'
|
||||
import { downloadAllDropshipPalletLabels, downloadDropshipPalletLabel, downloadInboundCartonLabels, downloadInboundCartonLabelsBatch, downloadPlatformInboundHoldEvidence, getPlatformInbound, getPlatformInboundHold, holdPlatformInbound, listPlatformInboundDropshipPallets, listPlatformInbounds, releasePlatformInbound, uploadPlatformInboundHoldEvidence } from './api'
|
||||
|
||||
vi.mock('@/shared/api/http', () => ({
|
||||
ApiResponseError: class ApiResponseError extends Error {
|
||||
@@ -87,6 +87,21 @@ describe('platform inbound query API', () => {
|
||||
expect(http.get).toHaveBeenCalledWith('/platform/v1/first-leg/pda-dropship/inbound-orders/19001/pallets', { params: { accountId: '10001' } })
|
||||
})
|
||||
|
||||
it('downloads one or all inbound-scoped dropship pallet documents for desktop printing', async () => {
|
||||
const pdf = new Blob(['pdf'], { type: 'application/pdf' })
|
||||
vi.mocked(http.get).mockResolvedValue(pdf)
|
||||
|
||||
await expect(downloadDropshipPalletLabel('10001', '19001', '21001')).resolves.toBe(pdf)
|
||||
await expect(downloadAllDropshipPalletLabels('10001', '19001')).resolves.toBe(pdf)
|
||||
|
||||
expect(http.get).toHaveBeenNthCalledWith(1,
|
||||
'/platform/v1/first-leg/pda-dropship/inbound-orders/19001/pallets/21001/print',
|
||||
{ params: { accountId: '10001' }, responseType: 'blob', timeout: 60_000 })
|
||||
expect(http.get).toHaveBeenNthCalledWith(2,
|
||||
'/platform/v1/first-leg/pda-dropship/inbound-orders/19001/pallets/print',
|
||||
{ params: { accountId: '10001' }, responseType: 'blob', timeout: 60_000 })
|
||||
})
|
||||
|
||||
it('passes the implemented order, process, measurement and fee review filters without renaming them', async () => {
|
||||
vi.mocked(http.get).mockResolvedValue({
|
||||
code: '200', message: 'success', data: { records: [], page: 1, size: 20, total: 0, pages: 0 },
|
||||
|
||||
Reference in New Issue
Block a user