优化
This commit is contained in:
@@ -64,6 +64,33 @@ describe('CarrierScheduleQueryPanel loading states', () => {
|
||||
expect(getPortSchedule).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('keeps complete ordered facts in the dense table and preserves the non-dense timeline', async () => {
|
||||
vi.mocked(listCarrierScheduleQueries).mockResolvedValue({ records: [], page: 1, size: 200, total: 0, pages: 0 })
|
||||
const summary = '长说明:核验装柜结果及相关业务记录,保留全部内容。'.repeat(4)
|
||||
const wrapper = mount(CarrierScheduleQueryPanel, {
|
||||
props: { dense: true, oceanBookingId: '2', warehouseTimeline: [
|
||||
{ eventType: 'PDA_SUBMIT_PICK', detail: summary, operatorName: '仓库作业员', occurredAt: '2026-08-20T08:00:00' },
|
||||
{ eventType: 'PDA_COMPLETE_LOADING', detail: '完成装柜', operatorName: '复核员', occurredAt: '2026-08-20T09:00:00' },
|
||||
] },
|
||||
global: { plugins: [ElementPlus, pinia] },
|
||||
})
|
||||
await flushPromises()
|
||||
|
||||
const table = wrapper.get('table[aria-label="货柜履约轨迹"]')
|
||||
expect(table.findAll('thead th').map(cell => cell.text())).toEqual(['时间', '类型', '事件', '说明', '操作人 / 来源'])
|
||||
const rows = table.findAll('tbody tr')
|
||||
expect(rows).toHaveLength(2)
|
||||
expect(rows[0]!.text()).toContain('2026-08-20 09:00')
|
||||
expect(rows[1]!.findAll('td')[3]!.text()).toBe(summary)
|
||||
expect(rows[1]!.findAll('td')[4]!.text()).toBe('仓库作业员')
|
||||
expect(wrapper.find('.fulfillment-timeline').exists()).toBe(false)
|
||||
|
||||
await wrapper.setProps({ dense: false })
|
||||
expect(wrapper.find('table[aria-label="货柜履约轨迹"]').exists()).toBe(false)
|
||||
expect(wrapper.findAll('.fulfillment-timeline li')).toHaveLength(2)
|
||||
wrapper.unmount()
|
||||
})
|
||||
|
||||
it('shows manual entry without creating a tracking task', async () => {
|
||||
vi.mocked(listCarrierScheduleQueries).mockResolvedValue({ records: [], page: 1, size: 200, total: 0, pages: 0 })
|
||||
const wrapper = mount(CarrierScheduleQueryPanel, { props: { oceanBookingId: '2', containerBookingId: '3' }, global: { plugins: [ElementPlus, pinia] } })
|
||||
|
||||
Reference in New Issue
Block a user