feat(shipping-notice): 收敛复核阶段同源投影与 OT 后履约推进
统一 Case/Progress 阶段 label_key、修复 Job 成功未推进 OT 的可重试失败投影与写路径,并落地 OT 后行级匹配/波次履约与版面诊断开关。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
74270adc22
commit
fd6a23f870
100 files changed
+12138
-1017
No files matched your search
+73
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* features/chat/components/shipping-review/ReviewLineFulfillmentDetail.spec.ts
|
||||
* 用途:锁定 UI-2 行内履约摘要字段与审计入口。
|
||||
*/
|
||||
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { createI18n } from 'vue-i18n';
|
||||
import ReviewLineFulfillmentDetail from './ReviewLineFulfillmentDetail.vue';
|
||||
import type { ShippingOrderReviewLineFulfillmentLine } from '@/features/chat/types/shipping.api.types';
|
||||
|
||||
const i18n = createI18n({
|
||||
legacy: false,
|
||||
locale: 'zh-CN',
|
||||
messages: {
|
||||
'zh-CN': {
|
||||
chat: {
|
||||
shippingOrderReview: {
|
||||
lineFulfillmentDetail: {
|
||||
title: '行履约摘要',
|
||||
wave: '履约波次',
|
||||
task: '正式任务',
|
||||
snapshotId: '库存快照 ID',
|
||||
matchedAt: '匹配校验时间',
|
||||
decisionSource: '决定来源',
|
||||
decisionSourceValue: {
|
||||
system: '系统自动',
|
||||
user: '人工',
|
||||
unknown: '未知',
|
||||
},
|
||||
failureReason: '自动履约失败原因',
|
||||
noFailure: '无',
|
||||
openAudit: '打开审计',
|
||||
close: '收起',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
describe('ReviewLineFulfillmentDetail', () => {
|
||||
it('renders wave/task/snapshot/source/failure and emits audit', async () => {
|
||||
const line: ShippingOrderReviewLineFulfillmentLine = {
|
||||
line_key: 'L1',
|
||||
inventory_snapshot_id: 42,
|
||||
inventory_checked_at: '2026-08-07T01:00:00Z',
|
||||
decision_source: 'system',
|
||||
auto_fulfill_error_message: 'wave_explode',
|
||||
decision: {
|
||||
wave_no: 3,
|
||||
task_id: 9,
|
||||
decision_source: 'system',
|
||||
},
|
||||
};
|
||||
const wrapper = mount(ReviewLineFulfillmentDetail, {
|
||||
props: { line, taskNo: 'SN-100' },
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
|
||||
expect(wrapper.find('[data-testid="review-line-fulfillment-summary"]').exists()).toBe(true);
|
||||
expect(wrapper.find('[data-testid="review-line-fulfillment-field-wave"]').text()).toContain('3');
|
||||
expect(wrapper.find('[data-testid="review-line-fulfillment-field-task"]').text()).toContain('SN-100');
|
||||
expect(wrapper.find('[data-testid="review-line-fulfillment-field-snapshot"]').text()).toContain('42');
|
||||
expect(wrapper.find('[data-testid="review-line-fulfillment-field-decisionSource"]').text()).toContain('系统自动');
|
||||
expect(wrapper.find('[data-testid="review-line-fulfillment-field-failure"]').text()).toContain('wave_explode');
|
||||
|
||||
await wrapper.get('[data-testid="review-line-fulfillment-open-audit"]').trigger('click');
|
||||
expect(wrapper.emitted('open-audit')).toBeTruthy();
|
||||
await wrapper.get('[data-testid="review-line-fulfillment-summary-close"]').trigger('click');
|
||||
expect(wrapper.emitted('close')).toBeTruthy();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user