优化
This commit is contained in:
@@ -22,6 +22,12 @@ describe('platform container customs API', () => {
|
|||||||
expect(result.documents[0]?.documentId).toBe('2092438843630391407')
|
expect(result.documents[0]?.documentId).toBe('2092438843630391407')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('returns null while the loading plan is not completed', async () => {
|
||||||
|
vi.spyOn(http, 'get').mockResolvedValue({ code: '200', message: 'ok', data: null })
|
||||||
|
|
||||||
|
await expect(getContainerCustoms('2097922185010147329')).resolves.toBeNull()
|
||||||
|
})
|
||||||
|
|
||||||
it('sends confirmed start and all-buy completion with optimistic version and idempotency', async () => {
|
it('sends confirmed start and all-buy completion with optimistic version and idempotency', async () => {
|
||||||
const post = vi.spyOn(http, 'post').mockResolvedValue({ code: '200', message: 'ok', data: customs })
|
const post = vi.spyOn(http, 'post').mockResolvedValue({ code: '200', message: 'ok', data: customs })
|
||||||
await startContainerCustoms('2092438843630391402', 3)
|
await startContainerCustoms('2092438843630391402', 3)
|
||||||
|
|||||||
@@ -92,6 +92,18 @@ describe('ContainerCustomsPanel', () => {
|
|||||||
expect(buttonTexts(wrapper)).not.toContain('导出买单 XLSX')
|
expect(buttonTexts(wrapper)).not.toContain('导出买单 XLSX')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('shows a pending state instead of an error before loading is completed', async () => {
|
||||||
|
api.get.mockResolvedValue(null)
|
||||||
|
const wrapper = mount(ContainerCustomsPanel, {
|
||||||
|
props: { loadingPlanId: '2097922185010147329', canList: true, canManage: false, departureState: 'WAITING_OTHER_GATES' },
|
||||||
|
global: { plugins: [ElementPlus] },
|
||||||
|
})
|
||||||
|
await flushPromises()
|
||||||
|
|
||||||
|
expect(wrapper.text()).toContain('当前装柜计划尚未完成,完成装柜后可处理报关')
|
||||||
|
expect(wrapper.text()).not.toContain('整柜报关加载失败')
|
||||||
|
})
|
||||||
|
|
||||||
it('allows completion upload and overwrite only while DECLARING with manage permission', async () => {
|
it('allows completion upload and overwrite only while DECLARING with manage permission', async () => {
|
||||||
let wrapper = await render('DECLARING', true, false)
|
let wrapper = await render('DECLARING', true, false)
|
||||||
expect(wrapper.text()).toContain('上传报关完成文件')
|
expect(wrapper.text()).toContain('上传报关完成文件')
|
||||||
|
|||||||
Reference in New Issue
Block a user