feat: confirm container inbound plans
This commit is contained in:
@@ -20,9 +20,28 @@ describe('container inbound plan preview contract', () => {
|
||||
expect(pageSource).not.toContain('containerPreview.groups.sort(')
|
||||
})
|
||||
|
||||
it('requests one preview per selection and does not submit the legacy conversion command', () => {
|
||||
it('requests one preview per selection and submits one atomic snapshot command', () => {
|
||||
expect(pageSource.match(/await getContainerInboundPlanPreview\(sourceContainerBookingId\)/g)).toHaveLength(1)
|
||||
expect(pageSource).not.toContain('convertLastMileContainerToInboundPlans')
|
||||
expect(pageSource).toContain(':confirm-disabled="true"')
|
||||
expect(pageSource).toContain('containerPreviewLoadingBookingId === sourceContainerBookingId')
|
||||
expect(pageSource).toContain('request !== containerPreviewRequest || selectedContainerBookingId.value !== sourceContainerBookingId || !containerConvertOpen.value')
|
||||
expect(pageSource).toContain('containerPreviewRequest += 1')
|
||||
expect(pageSource.match(/await convertLastMileContainerToInboundPlans\(\{/g)).toHaveLength(1)
|
||||
expect(pageSource).toContain('snapshotVersion: preview.snapshotVersion')
|
||||
expect(pageSource).toContain('snapshotHash: preview.snapshotHash')
|
||||
expect(pageSource).toContain('containerConversionIdempotencyKey')
|
||||
expect(pageSource).toContain(':confirm-disabled="containerConfirmDisabled"')
|
||||
})
|
||||
|
||||
it('shows returned plan numbers and real pallet numbers then refreshes the page and preview', () => {
|
||||
expect(pageSource).toContain('containerConversionResult.plans')
|
||||
expect(pageSource).toContain('plan.pallets')
|
||||
expect(pageSource).toContain('pallet.palletNo')
|
||||
expect(pageSource).toContain('Promise.all([load(), loadContainerPreview(bookingId, true)])')
|
||||
})
|
||||
|
||||
it('translates known blockers and never exposes unknown internal blocker codes', () => {
|
||||
expect(pageSource).toContain("PALLET_COUNT_NOT_READY: '计划托数暂未就绪'")
|
||||
expect(pageSource).toContain("labels[code] || '计划数据暂未就绪,请刷新或联系管理员'")
|
||||
expect(pageSource).not.toContain('labels[code] || code')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user