This commit is contained in:
2026-09-04 18:47:43 +08:00
parent 39ade43a72
commit 48731b227b
8 changed files with 62 additions and 54 deletions
@@ -4,6 +4,7 @@ import { listPlatformUnifiedOrders, updatePlatformUnifiedOrderPlanning } from '@
import { createPlatformExportTask } from '@/modules/downloads'
import { showExportTaskCreatedDialog } from '@/shared/components/exportTaskCreatedDialog'
import { ApiResponseError } from '@/shared/api/http'
import { ElMessage } from 'element-plus'
import UnifiedOrdersView from './UnifiedOrdersView.vue'
vi.mock('vue-router', () => ({
@@ -192,7 +193,8 @@ describe('UnifiedOrdersView list request coordination', () => {
}))
})
it('edits arrival and estimated volume with the row version and preserves evidence on failure', async () => {
it('edits arrival and estimated volume and reports compact failure evidence through a message', async () => {
const errorMessage = vi.spyOn(ElMessage, 'error').mockImplementation(() => undefined as never)
vi.mocked(listPlatformUnifiedOrders).mockResolvedValue({
records: [{
orderId: '2089223263733518337', orderVersion: 7, tenantId: '2089176869176389634',
@@ -225,7 +227,11 @@ describe('UnifiedOrdersView list request coordination', () => {
expectedVersion: 8, expectedArrivalAt: '2026-09-12T16:00:00', estimatedVolumeCbm: 0.5,
})
expect(wrapper.getComponent({ name: 'ElDatePicker' }).props('modelValue')).toBe('2026-09-12T16:00:00')
expect(wrapper.text()).toContain('订单版本已变化')
expect(wrapper.text()).toContain('A0409 req-planning trace-planning')
expect(wrapper.text()).not.toContain('订单版本已变化')
expect(wrapper.find('.planning-error').exists()).toBe(false)
expect(errorMessage).toHaveBeenCalledWith(expect.objectContaining({
message: '订单版本已变化(错误码 A0409;Request ID req-planning;Trace ID trace-planning)',
showClose: true,
}))
})
})