This commit is contained in:
2026-08-08 12:01:52 +08:00
parent bc14ec7bd2
commit 24af934198
3 changed files with 25 additions and 6 deletions
@@ -50,6 +50,23 @@ describe('unified orders API contract', () => {
})
})
it('forwards every main-status tab with search and pagination unchanged', async () => {
const statuses = [
'PENDING_REVIEW', 'WAIT_MEASURE', 'INBOUNDED', 'WAIT_SPLIT',
'LOADING', 'LOADED', 'DELIVERED',
] as const
vi.mocked(http.get).mockResolvedValue({ data: { records: [], page: 3, size: 20, total: 0, pages: 0 } })
for (const mainStatus of statuses) {
await listPlatformUnifiedOrders({ keyword: 'CC-2026', orderNo: 'FL-77', mainStatus, page: 3, size: 20 })
}
expect(vi.mocked(http.get).mock.calls).toEqual(statuses.map((mainStatus) => [
'/platform/v1/orders',
{ params: { keyword: 'CC-2026', orderNo: 'FL-77', mainStatus, page: 3, size: 20 } },
]))
})
it('normalizes C02 row IDs and keeps inboundId for measurement routing', async () => {
vi.mocked(http.get).mockResolvedValue({ data: {
records: [{ orderId: '90001', tenantId: '208', inboundId: '77', inboundVersion: 3, mainStatus: 'WAIT_MEASURE', customerRemark: '客户备注', latestInternalNote: '最新内部备注', measurement: null, preload: null, loading: null, delivery: null, transport: null }],