优化
This commit is contained in:
@@ -30,10 +30,21 @@ beforeEach(() => {
|
||||
})
|
||||
|
||||
describe('outsourced business views', () => {
|
||||
it('keeps an owned vehicle with pooled cargo in the outsourced task list', async () => {
|
||||
const detail = outsourcedBusinessFixture()
|
||||
detail.row.vehicle.ownership = 'OWNED'
|
||||
calls.list.mockResolvedValue({ records: [detail.row], page: 1, size: 20, total: 1, summary: { dispatchCount: 1, afterLoadingCount: 1, deliveringCount: 0, deliveredCount: 0 } })
|
||||
const wrapper = mount(OutsourcedBusinessView, { global }); await flushPromises()
|
||||
expect(wrapper.findComponent(Table).props('data')[0].vehicle.ownership).toBe('OWNED')
|
||||
expect(wrapper.findComponent(Table).props('total')).toBe(1)
|
||||
expect(wrapper.text()).toContain('外配任务')
|
||||
expect(wrapper.text()).toContain('登记运营信息')
|
||||
wrapper.unmount()
|
||||
})
|
||||
it('uses one list request for all statistics and never hydrates each row', async () => {
|
||||
const wrapper = mount(OutsourcedBusinessView,{global}); await flushPromises()
|
||||
expect(calls.list).toHaveBeenCalledTimes(1); expect(calls.detail).not.toHaveBeenCalled(); expect(calls.content).not.toHaveBeenCalled()
|
||||
expect(wrapper.find('[aria-label="完整筛选范围外配业务统计"]').text()).toContain('排车数41')
|
||||
expect(wrapper.find('[aria-label="完整筛选范围外配任务统计"]').text()).toContain('排车数41')
|
||||
expect(wrapper.text()).not.toContain('今日排车')
|
||||
expect(wrapper.findComponent(Table).props('columns')[0].key).toBe('actions')
|
||||
expect(wrapper.findComponent(Table).props('total')).toBe(41)
|
||||
@@ -46,7 +57,7 @@ describe('outsourced business views', () => {
|
||||
expect(calls.list).toHaveBeenCalledTimes(1)
|
||||
query.vm.$emit('search');await flushPromises()
|
||||
expect(calls.list).toHaveBeenLastCalledWith({page:1,size:20,keyword:'FBA-1',stage:'AFTER_LOADING',warehouseId:'1',plannedDepartureFrom:dayjs('2026-10-20').startOf('day').toISOString(),plannedDepartureTo:dayjs('2026-10-21').add(1,'day').startOf('day').toISOString()})
|
||||
expect(wrapper.find('[aria-label="完整筛选范围外配业务统计"]').text()).toContain('装车完成30')
|
||||
expect(wrapper.find('[aria-label="完整筛选范围外配任务统计"]').text()).toContain('装车完成30')
|
||||
wrapper.unmount()
|
||||
})
|
||||
it('opens the operations modal on demand with auxiliary zero version instead of the dispatch version', async () => {
|
||||
|
||||
Reference in New Issue
Block a user