优化
This commit is contained in:
@@ -395,12 +395,33 @@ describe('GlobalSmartLoadingView', () => {
|
||||
const fields = wrapper.findComponent(QueryToolbar).props('fields') as Array<{ key: string; options?: Array<{ label: string; value: string }> }>
|
||||
expect(fields.map((field) => field.key)).toEqual(['warehouseId', 'customerId', 'inboundCode', 'expectedArrivalRange', 'orderStatus'])
|
||||
expect(fields.find((field) => field.key === 'warehouseId')?.options).toEqual([{ label: '义乌仓', value: '8' }])
|
||||
expect(fields.find((field) => field.key === 'orderStatus')?.options).toEqual([
|
||||
{ value: '', label: '全部' },
|
||||
{ value: 'PENDING_REVIEW', label: '待审核' },
|
||||
{ value: 'WAIT_MEASURE', label: '待测量数据' },
|
||||
{ value: 'WAIT_SPLIT', label: '待分柜' },
|
||||
{ value: 'LOADING', label: '装柜中' },
|
||||
])
|
||||
expect(source).not.toContain('目的仓')
|
||||
|
||||
expect(wrapper.text()).not.toContain('税率')
|
||||
expect(wrapper.text()).not.toContain('是否退税')
|
||||
})
|
||||
|
||||
it('filters completed loading candidates out even when all statuses are selected', async () => {
|
||||
vi.mocked(listSmartLoadingCandidates).mockResolvedValue([
|
||||
candidate,
|
||||
{ ...candidate, inboundId: '6', orderId: '8', inboundCode: 'IN-LOADED', orderStatusSnapshot: 'LOADED' },
|
||||
{ ...candidate, inboundId: '7', orderId: '9', inboundCode: 'IN-COMPLETED', orderStatusSnapshot: 'COMPLETED' },
|
||||
])
|
||||
const wrapper = mount(GlobalSmartLoadingView, { global: { plugins: [ElementPlus] } })
|
||||
await flushPromises()
|
||||
|
||||
expect(wrapper.get('.candidate-pane').text()).toContain('IN-2')
|
||||
expect(wrapper.get('.candidate-pane').text()).not.toContain('IN-LOADED')
|
||||
expect(wrapper.get('.candidate-pane').text()).not.toContain('IN-COMPLETED')
|
||||
})
|
||||
|
||||
it('prefers an editing container on first load while keeping loading containers available', async () => {
|
||||
const pushed = { ...container, id: '9007199254740995', planStatus: 'LOADING' as const }
|
||||
vi.mocked(listContainers).mockResolvedValue({ records: [pushed, container], page: 1, size: 100, total: 2, pages: 1 })
|
||||
|
||||
Reference in New Issue
Block a user