test(shipping): 更新订单复核库存与通知流程测试
This commit is contained in:
1 parent
8ec028e6a3
commit
265a6e179a
168 files changed
+9420
-4613
No files matched your search
+29
-1
@@ -99,7 +99,9 @@ describe('ReviewCurrentProcessingCard', () => {
|
||||
expect(wrapper.find('[data-testid="review-current-processing-retry"]').exists()).toBe(true);
|
||||
});
|
||||
|
||||
it('renders reload inventory result as the timeout primary action', () => {
|
||||
it('renders a code-agnostic primary action label from a registered recovery code', () => {
|
||||
// 卡片是 code-agnostic 渲染器:只要后端下发了受控文案键,就渲染对应业务动作文案。
|
||||
// 此用例用 reload_inventory_result(仍为写契约有效码)验证卡片对库存动作文案的渲染。
|
||||
const wrapper = mount(ReviewCurrentProcessingCard, {
|
||||
props: {
|
||||
stageCode: 'inventory_preparation', userStatus: 'retryable', retryable: true,
|
||||
@@ -309,4 +311,30 @@ describe('ReviewCurrentProcessingCard', () => {
|
||||
expect(wrapper.get('[data-testid="review-current-task-stage"]').text()).toBe('正在获取最新状态…');
|
||||
expect(wrapper.get('[data-testid="review-current-task-status"]').text()).toBe('待机');
|
||||
});
|
||||
|
||||
it('renders an embedded status detail line when provided', () => {
|
||||
const wrapper = mount(ReviewCurrentProcessingCard, {
|
||||
props: {
|
||||
userStatus: 'running',
|
||||
stageCode: 'intake_parse',
|
||||
statusDetail: { text: '正在等待解析任务启动' },
|
||||
},
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
// 关键断言:说明内嵌于状态行下方(弱文本一行),带 aria-live 与固定 testid;
|
||||
// 状态行仍为短标签(系统处理中),长句不进入状态位。
|
||||
const detail = wrapper.get('[data-testid="review-current-task-status-detail"]');
|
||||
expect(detail.text()).toBe('正在等待解析任务启动');
|
||||
expect(detail.attributes('aria-live')).toBe('polite');
|
||||
expect(wrapper.get('[data-testid="review-current-task-status"]').text()).toContain('系统处理中');
|
||||
});
|
||||
|
||||
it('renders no status detail line without the prop', () => {
|
||||
const wrapper = mount(ReviewCurrentProcessingCard, {
|
||||
props: { userStatus: 'waiting_human', stageCode: 'order_review' },
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
// 关键断言:无 statusDetail 时说明行完全不渲染,不留空壳。
|
||||
expect(wrapper.find('[data-testid="review-current-task-status-detail"]').exists()).toBe(false);
|
||||
});
|
||||
});
|
||||
+222
-20
@@ -293,6 +293,51 @@ describe('ShippingConversationProcessingCard', () => {
|
||||
expect(wrapper.text()).not.toContain('snapshot-attachment.pdf');
|
||||
});
|
||||
|
||||
it('keeps selected but unrecognized EML attachments visible without file actions', async () => {
|
||||
const projection = buildProjection();
|
||||
setStatusGroup(projection, 'processing', [{
|
||||
user_task_no: 'INTAKE:EML-PENDING', group: 'processing', status_label: 'extracting',
|
||||
title: 'pending-mail.eml', file_count: 2, run_no: 'RUN-EML-PENDING', can_append: false,
|
||||
}]);
|
||||
const recognizedLeaf = buildWorkItem('DOCUMENT:91', {
|
||||
sourceType: 'eml', rootOrderTaskNo: 'OT-EML-PENDING',
|
||||
sourceSummary: {
|
||||
emailSubject: null, filename: 'recognized.pdf', documentId: 91,
|
||||
documentCount: 1, parsedDocumentCount: 1, candidateCount: 1,
|
||||
customerName: null, poNumber: null,
|
||||
},
|
||||
});
|
||||
const pendingLeaf = buildWorkItem('PLAN:EML-PENDING:missing.pdf', {
|
||||
workItemType: 'order_intake', sourceType: 'eml', rootOrderTaskNo: null,
|
||||
sourceSummary: {
|
||||
emailSubject: null, filename: 'missing.pdf', documentId: null,
|
||||
documentCount: 0, parsedDocumentCount: 0, candidateCount: 0,
|
||||
customerName: null, poNumber: null,
|
||||
},
|
||||
facts: { recognized: false, planState: 'selected_pending' },
|
||||
uiState: undefined,
|
||||
});
|
||||
const root = buildWorkItem('INTAKE:EML-PENDING', {
|
||||
sourceType: 'eml', rootOrderTaskNo: 'OT-EML-PENDING',
|
||||
sourceSummary: {
|
||||
emailSubject: 'Pending mail', filename: 'pending-mail.eml', documentId: null,
|
||||
documentCount: 2, parsedDocumentCount: 1, candidateCount: 1,
|
||||
customerName: null, poNumber: null,
|
||||
},
|
||||
aggregateChildren: [recognizedLeaf, pendingLeaf],
|
||||
});
|
||||
const wrapper = mount(ShippingConversationProcessingCard, {
|
||||
props: { projection, workItems: [root], workbenchMode: true },
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
await flushPromises();
|
||||
|
||||
const pendingRow = wrapper.get('[data-testid="shipping-processing-file-INTAKE:EML-PENDING-live-PLAN:EML-PENDING:missing.pdf"]');
|
||||
expect(pendingRow.text()).toContain('missing.pdf');
|
||||
expect(pendingRow.text()).toContain('待识别');
|
||||
expect(pendingRow.find('button').exists()).toBe(false);
|
||||
});
|
||||
|
||||
it('counts only stage-filtered EML leaves in the batch status heading', async () => {
|
||||
const projection = buildProjection();
|
||||
setStatusGroup(projection, 'processing', [{
|
||||
@@ -330,6 +375,91 @@ describe('ShippingConversationProcessingCard', () => {
|
||||
expect(wrapper.get('[data-testid="shipping-processing-group-processing"]').text()).not.toContain('2 个文件');
|
||||
});
|
||||
|
||||
it('keeps backend processing rows visible while matching work items are still unavailable', async () => {
|
||||
const processingLeaf = buildWorkItem('DOCUMENT:610', {
|
||||
sourceType: 'eml', rootOrderTaskNo: 'OT-PROCESSING-SNAPSHOT',
|
||||
sourceSummary: { ...buildWorkItem('DOCUMENT:610').sourceSummary, documentId: 610, filename: 'processing.pdf' },
|
||||
uiState: {
|
||||
status: 'running', stage: 'document_parsing', lifecycleStage: 'intake_parse',
|
||||
lifecycleEntries: [], blocking_reason: null, primary_action: null, secondary_actions: [],
|
||||
},
|
||||
});
|
||||
const projection = projectionWithGroups(
|
||||
{ total_tasks: 1, processing: 1, needs_action: 0, completed: 0, history: 0 },
|
||||
{
|
||||
failed: [], waiting_human: [],
|
||||
processing: [{
|
||||
user_task_no: 'OT-PROCESSING-SNAPSHOT', group: 'processing', status_label: 'processing',
|
||||
title: 'processing.eml', file_count: 1, run_no: 'RUN-PROCESSING-SNAPSHOT', can_append: false,
|
||||
aggregateChildren: [processingLeaf],
|
||||
}],
|
||||
completed: [], cancelled: [], archived: [],
|
||||
},
|
||||
);
|
||||
const wrapper = mount(ShippingConversationProcessingCard, {
|
||||
props: { projection, workItems: [], workbenchMode: true },
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
await flushPromises();
|
||||
|
||||
// 状态分组先到达时,须以同次响应的叶子快照保留处理中附件。
|
||||
const group = wrapper.get('[data-testid="shipping-processing-group-processing"]');
|
||||
expect(group.text()).toContain('处理中 · 1 个文件');
|
||||
expect(group.text()).toContain('processing.pdf');
|
||||
});
|
||||
|
||||
it('shows a mixed-status EML once per PDF status without mixing completed files', async () => {
|
||||
const completedLeaf = buildWorkItem('DOCUMENT:501', {
|
||||
sourceType: 'eml', rootOrderTaskNo: 'OT-MIXED-STATUS',
|
||||
sourceSummary: { ...buildWorkItem('DOCUMENT:501').sourceSummary, documentId: 501, filename: 'done.pdf' },
|
||||
uiState: {
|
||||
status: 'completed', stage: 'completed', lifecycleStage: 'upload_complete',
|
||||
lifecycleEntries: [], blocking_reason: null, primary_action: null, secondary_actions: [],
|
||||
},
|
||||
});
|
||||
const processingLeaf = buildWorkItem('DOCUMENT:502', {
|
||||
sourceType: 'eml', rootOrderTaskNo: 'OT-MIXED-STATUS',
|
||||
sourceSummary: { ...buildWorkItem('DOCUMENT:502').sourceSummary, documentId: 502, filename: 'running.pdf' },
|
||||
uiState: {
|
||||
status: 'running', stage: 'freight_upload', lifecycleStage: 'freight_upload',
|
||||
lifecycleEntries: [], blocking_reason: null, primary_action: null, secondary_actions: [],
|
||||
},
|
||||
});
|
||||
const root = buildWorkItem('INTAKE:MIXED-STATUS', {
|
||||
sourceType: 'eml', rootOrderTaskNo: 'OT-MIXED-STATUS',
|
||||
sourceSummary: { ...buildWorkItem('INTAKE:MIXED-STATUS').sourceSummary, filename: 'mixed.eml', documentId: null },
|
||||
aggregateChildren: [completedLeaf, processingLeaf],
|
||||
});
|
||||
const task = {
|
||||
user_task_no: 'OT-MIXED-STATUS', title: 'mixed.eml', file_count: 1, run_no: 'RUN-MIXED-STATUS', can_append: false,
|
||||
aggregateSummary: { intakeNo: 'SNI-MIXED-STATUS', total: 2, in_group: 1 },
|
||||
};
|
||||
const wrapper = mount(ShippingConversationProcessingCard, {
|
||||
props: {
|
||||
projection: projectionWithGroups(
|
||||
{ total_tasks: 2, processing: 1, needs_action: 0, completed: 1, history: 0 },
|
||||
{
|
||||
failed: [], waiting_human: [],
|
||||
processing: [{ ...task, group: 'processing', status_label: 'processing', aggregateChildren: [processingLeaf] }],
|
||||
completed: [{ ...task, group: 'completed', status_label: 'completed', aggregateChildren: [completedLeaf] }],
|
||||
cancelled: [], archived: [],
|
||||
},
|
||||
),
|
||||
workItems: [root], workbenchMode: true,
|
||||
},
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
await flushPromises();
|
||||
|
||||
expect(wrapper.get('[data-testid="shipping-processing-group-processing"]').text()).toContain('running.pdf');
|
||||
expect(wrapper.get('[data-testid="shipping-processing-group-processing"]').text()).not.toContain('done.pdf');
|
||||
expect(wrapper.get('[data-testid="shipping-processing-group-processing"]').text()).toContain('本组 1/共 2 个文件');
|
||||
await wrapper.get('[data-testid="shipping-processing-history-toggle"]').trigger('click');
|
||||
expect(wrapper.get('[data-testid="shipping-processing-history-completed"]').text()).toContain('done.pdf');
|
||||
expect(wrapper.get('[data-testid="shipping-processing-history-completed"]').text()).not.toContain('running.pdf');
|
||||
expect(wrapper.get('[data-testid="shipping-processing-history-completed"]').text()).toContain('本组 1/共 2 个文件');
|
||||
});
|
||||
|
||||
it('keeps an EML attachment when it has a linked child order task', async () => {
|
||||
const projection = buildProjection();
|
||||
setStatusGroup(projection, 'processing', [{
|
||||
@@ -386,15 +516,15 @@ describe('ShippingConversationProcessingCard', () => {
|
||||
expect(wrapper.find('[data-testid="shipping-conversation-processing-card"]').exists()).toBe(true);
|
||||
expect(wrapper.find('[data-testid="shipping-processing-group-failed"]').exists()).toBe(true);
|
||||
expect(wrapper.find('[data-testid="shipping-processing-group-processing"]').exists()).toBe(true);
|
||||
// 批次中心统一按文件计数;旧任务数文案不再是页面统计口径。
|
||||
expect(wrapper.text()).toContain('异常 · 0 个文件');
|
||||
expect(wrapper.text()).toContain('处理中 · 0 个文件');
|
||||
// 状态组与对话流一致,未展开附件时仍按后端 file_count 统计。
|
||||
expect(wrapper.text()).toContain('异常 · 2 个文件');
|
||||
expect(wrapper.text()).toContain('处理中 · 1 个文件');
|
||||
expect(wrapper.text()).toContain('刚刚创建');
|
||||
|
||||
// 处理记录默认折叠;标题 count = completed + history 返回条数。
|
||||
// 处理记录默认折叠;标题按文件数而非 EML / 任务行数统计。
|
||||
const historyGroup = wrapper.find('[data-testid="shipping-processing-group-history"]');
|
||||
expect(historyGroup.exists()).toBe(true);
|
||||
expect(historyGroup.text()).toContain('处理记录 · 3');
|
||||
expect(historyGroup.text()).toContain('处理记录 · 3 个文件');
|
||||
expect(wrapper.find('[data-testid="shipping-processing-history-body"]').exists()).toBe(false);
|
||||
expect(wrapper.find('[data-testid="shipping-processing-task-OT-DONE"]').exists()).toBe(false);
|
||||
expect(wrapper.find('[data-testid="shipping-processing-task-OT-HIST"]').exists()).toBe(false);
|
||||
@@ -464,7 +594,7 @@ describe('ShippingConversationProcessingCard', () => {
|
||||
const doneCard = wrapper.find('[data-testid="shipping-processing-task-OT-DONE"]');
|
||||
expect(doneCard.find('[data-testid="sidebar-progress-inline"]').exists()).toBe(false);
|
||||
expect(doneCard.find('[data-testid="shipping-processing-task-actions"]').exists()).toBe(false);
|
||||
expect(doneCard.find('[data-testid="shipping-processing-action-view_result"]').exists()).toBe(true);
|
||||
expect(doneCard.find('[data-testid="shipping-processing-action-view_result"]').exists()).toBe(false);
|
||||
expect(doneCard.find('[data-testid="shipping-processing-action-cancel_task"]').exists()).toBe(false);
|
||||
});
|
||||
|
||||
@@ -490,11 +620,11 @@ describe('ShippingConversationProcessingCard', () => {
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
await flushPromises();
|
||||
expect(wrapper.text()).toContain('订单识别任务');
|
||||
expect(wrapper.text()).toContain('本次订单文件处理');
|
||||
expect(wrapper.text()).toContain('2 个 PDF');
|
||||
expect(wrapper.text()).toContain('主文件:4518838152.pdf');
|
||||
const titleEl = wrapper.find('[data-testid="shipping-processing-task-OT-MULTI"] .text-sm.font-semibold');
|
||||
expect(titleEl.text()).toContain('订单识别任务');
|
||||
expect(titleEl.text()).toContain('本次订单文件处理');
|
||||
expect(titleEl.text()).not.toContain('4518838152.pdf');
|
||||
|
||||
// UI-02:有文件对象时不双开「查看详情」与「展开文件详情」。
|
||||
@@ -554,14 +684,14 @@ describe('ShippingConversationProcessingCard', () => {
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
await flushPromises();
|
||||
expect(wrapper.text()).toContain('订单识别任务');
|
||||
expect(wrapper.text()).toContain('本次订单文件处理');
|
||||
expect(wrapper.text()).toContain('2 个 PDF');
|
||||
const titleEl = wrapper.find('[data-testid="shipping-processing-task-OT-MULTI"] .text-sm.font-semibold');
|
||||
expect(titleEl.text()).toContain('订单识别任务');
|
||||
expect(titleEl.text()).toContain('本次订单文件处理');
|
||||
expect(titleEl.text()).not.toContain('4518838152.pdf');
|
||||
});
|
||||
|
||||
it('uses unified order recognition title instead of internal OT number', async () => {
|
||||
it('uses unified order file processing title instead of internal OT number', async () => {
|
||||
const wrapper = mount(ShippingConversationProcessingCard, {
|
||||
props: {
|
||||
projection: projectionWithGroups(
|
||||
@@ -580,7 +710,7 @@ describe('ShippingConversationProcessingCard', () => {
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
await flushPromises();
|
||||
expect(wrapper.text()).toContain('订单识别任务');
|
||||
expect(wrapper.text()).toContain('本次订单文件处理');
|
||||
expect(wrapper.text()).not.toContain('20260803-A13F95D2');
|
||||
});
|
||||
|
||||
@@ -597,7 +727,7 @@ describe('ShippingConversationProcessingCard', () => {
|
||||
expect(wrapper.emitted('expandFiles')).toBeUndefined();
|
||||
});
|
||||
|
||||
it('opens local task details without emitting a viewed write event', async () => {
|
||||
it('does not show a view-result action for completed records', async () => {
|
||||
const wrapper = mount(ShippingConversationProcessingCard, {
|
||||
props: {
|
||||
projection: {
|
||||
@@ -620,15 +750,87 @@ describe('ShippingConversationProcessingCard', () => {
|
||||
|
||||
await wrapper.find('[data-testid="shipping-processing-history-toggle"]').trigger('click');
|
||||
|
||||
await wrapper.find('[data-testid="shipping-processing-action-view_result"]').trigger('click');
|
||||
|
||||
expect(wrapper.emitted('taskAction')?.[0]?.[0]).toMatchObject({
|
||||
task: { user_task_no: 'OT-DETAIL' },
|
||||
action: 'view_result',
|
||||
});
|
||||
expect(wrapper.find('[data-testid="shipping-processing-action-view_result"]').exists()).toBe(false);
|
||||
expect(wrapper.emitted('taskAction')).toBeUndefined();
|
||||
expect(wrapper.emitted('viewed')).toBeUndefined();
|
||||
});
|
||||
|
||||
it('marks an unrecognized Excel attachment as ignored but keeps a pending PDF recognizable', async () => {
|
||||
const projection = buildProjection();
|
||||
setStatusGroup(projection, 'processing', [{
|
||||
user_task_no: 'INTAKE:EML-EXCEL', group: 'processing', status_label: 'extracting',
|
||||
title: 'mail.eml', file_count: 2, run_no: 'RUN-EML-EXCEL', can_append: false,
|
||||
aggregateChildren: [],
|
||||
}]);
|
||||
const pendingPdf = buildWorkItem('PLAN:EML-EXCEL:pending', {
|
||||
workItemType: 'order_intake', sourceType: 'eml', rootOrderTaskNo: null,
|
||||
sourceSummary: { emailSubject: null, filename: 'pending.pdf', documentId: null, documentCount: 0, parsedDocumentCount: 0, candidateCount: 0, customerName: null, poNumber: null },
|
||||
facts: { recognized: false, planState: 'selected_pending' }, uiState: undefined,
|
||||
});
|
||||
const ignoredExcel = buildWorkItem('PLAN:EML-EXCEL:report', {
|
||||
workItemType: 'order_intake', sourceType: 'eml', rootOrderTaskNo: null,
|
||||
sourceSummary: { emailSubject: null, filename: 'report.xlsx', documentId: null, documentCount: 0, parsedDocumentCount: 0, candidateCount: 0, customerName: null, poNumber: null },
|
||||
facts: { recognized: false, planState: 'selected_pending' }, uiState: undefined,
|
||||
});
|
||||
const root = buildWorkItem('INTAKE:EML-EXCEL', {
|
||||
sourceType: 'eml', rootOrderTaskNo: 'OT-EML-EXCEL',
|
||||
aggregateChildren: [pendingPdf, ignoredExcel],
|
||||
});
|
||||
projection.status_groups!.processing![0]!.aggregateChildren = [pendingPdf, ignoredExcel];
|
||||
const wrapper = mount(ShippingConversationProcessingCard, {
|
||||
props: { projection, workItems: [root], workbenchMode: true },
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
await flushPromises();
|
||||
|
||||
const processingGroup = wrapper.get('[data-testid="shipping-processing-group-processing"]');
|
||||
expect(processingGroup.text()).toContain('pending.pdf');
|
||||
expect(processingGroup.text()).not.toContain('report.xlsx');
|
||||
expect(wrapper.get('[data-testid="shipping-processing-file-INTAKE:EML-EXCEL-live-PLAN:EML-EXCEL:pending"]').text()).toContain('待识别');
|
||||
const ignoredGroup = wrapper.get('[data-testid="shipping-processing-group-ignored"]');
|
||||
expect(ignoredGroup.text()).toContain('已忽略 · 1 个文件');
|
||||
expect(wrapper.find('[data-testid="shipping-processing-ignored-body"]').exists()).toBe(false);
|
||||
await ignoredGroup.get('[data-testid="shipping-processing-ignored-toggle"]').trigger('click');
|
||||
const excelRow = ignoredGroup.get('[data-testid="shipping-processing-file-INTAKE:EML-EXCEL-live-PLAN:EML-EXCEL:report"]');
|
||||
expect(excelRow.text()).toContain('已忽略');
|
||||
expect(excelRow.text()).not.toContain('待识别');
|
||||
});
|
||||
|
||||
it('keeps an ignored Excel row when its EML parent originates from completed', async () => {
|
||||
const ignoredExcel = buildWorkItem('PLAN:EML-COMPLETED:report', {
|
||||
workItemType: 'order_intake', sourceType: 'eml', rootOrderTaskNo: null,
|
||||
sourceSummary: { emailSubject: null, filename: 'report.xlsx', documentId: null, documentCount: 0, parsedDocumentCount: 0, candidateCount: 0, customerName: null, poNumber: null },
|
||||
facts: { recognized: false, planState: 'selected_pending' }, uiState: undefined,
|
||||
});
|
||||
const root = buildWorkItem('INTAKE:EML-COMPLETED', {
|
||||
sourceType: 'eml', rootOrderTaskNo: 'OT-EML-COMPLETED',
|
||||
aggregateChildren: [ignoredExcel],
|
||||
});
|
||||
const projection = projectionWithGroups(
|
||||
{ total_tasks: 1, processing: 0, needs_action: 0, completed: 1, history: 0 },
|
||||
{
|
||||
failed: [], waiting_human: [], processing: [],
|
||||
completed: [{
|
||||
user_task_no: 'INTAKE:EML-COMPLETED', group: 'completed', status_label: 'completed',
|
||||
title: 'mail.eml', file_count: 1, run_no: 'RUN-EML-COMPLETED', can_append: false,
|
||||
aggregateChildren: [ignoredExcel],
|
||||
}],
|
||||
cancelled: [], archived: [],
|
||||
},
|
||||
);
|
||||
const wrapper = mount(ShippingConversationProcessingCard, {
|
||||
props: { projection, workItems: [root], workbenchMode: true },
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
await flushPromises();
|
||||
|
||||
const ignoredGroup = wrapper.get('[data-testid="shipping-processing-group-ignored"]');
|
||||
expect(ignoredGroup.text()).toContain('已忽略 · 1 个文件');
|
||||
expect(wrapper.find('[data-testid="shipping-processing-ignored-body"]').exists()).toBe(false);
|
||||
await ignoredGroup.get('[data-testid="shipping-processing-ignored-toggle"]').trigger('click');
|
||||
expect(ignoredGroup.get('[data-testid="shipping-processing-file-INTAKE:EML-COMPLETED-live-PLAN:EML-COMPLETED:report"]').text()).toContain('report.xlsx');
|
||||
});
|
||||
|
||||
it('applies visible focus ring on needs_action card when focused', async () => {
|
||||
const wrapper = mount(ShippingConversationProcessingCard, {
|
||||
props: {
|
||||
@@ -800,7 +1002,7 @@ describe('ShippingConversationProcessingCard', () => {
|
||||
|
||||
expect(wrapper.findAll('[data-testid="sidebar-progress-inline"]')).toHaveLength(2);
|
||||
expect(wrapper.find('[data-testid="shipping-processing-task-OT-NEED"]').text()).toContain('待人工处理');
|
||||
expect(wrapper.find('[data-testid="shipping-processing-task-OT-PROC"]').text()).toContain('库存匹配');
|
||||
expect(wrapper.find('[data-testid="shipping-processing-task-OT-PROC"]').text()).toContain('通知准备');
|
||||
expect(wrapper.findAll('[data-testid="shipping-processing-task-actions"]')).toHaveLength(0);
|
||||
const task = wrapper.find('[data-testid="shipping-processing-task-OT-NEED"]');
|
||||
expect(task.find('[data-testid="unified-action-primary"]').exists()).toBe(true);
|
||||
|
||||
+297
-8
@@ -183,7 +183,7 @@ describe('ShippingOrderExtractionCard', () => {
|
||||
|
||||
// 旧快照缺少会话级用户状态;candidate_ready 只能作为附件阶段,不能升格为顶层分组。
|
||||
expect(wrapper.text()).toContain('共 3 个文件');
|
||||
expect(wrapper.text()).toContain('0/3 已处理');
|
||||
expect(wrapper.text()).not.toContain('已处理');
|
||||
expect(wrapper.text()).not.toContain('已生成候选 3 个文件');
|
||||
expect(wrapper.text()).toContain('4210020274.pdf');
|
||||
expect(wrapper.text()).not.toContain('23/20 已处理');
|
||||
@@ -300,12 +300,52 @@ describe('ShippingOrderExtractionCard', () => {
|
||||
await wrapper.get('[data-testid="shipping-order-extraction-eml-failed-INTAKE:SNI-DETAIL"] button').trigger('click');
|
||||
expect(wrapper.get('[data-testid="shipping-order-extraction-eml-children"]').text()).toContain('failed.pdf');
|
||||
expect(wrapper.text()).toContain('异常 1');
|
||||
expect(wrapper.text()).toContain('当前步骤需要人工处理');
|
||||
// 通用兜底原因(当前步骤需要人工处理)与右侧状态芯片语义重复,统一隐藏。
|
||||
expect(wrapper.text()).not.toContain('当前步骤需要人工处理');
|
||||
expect(wrapper.text()).not.toContain('PARSE_FAILED');
|
||||
expect(wrapper.get('[data-testid="shipping-order-extraction-child-status-OT-CHILD-1"]')
|
||||
.classes()).toContain('text-rose-600');
|
||||
});
|
||||
|
||||
it('splits a mixed-status EML into its matching status sections', async () => {
|
||||
const completedA = {
|
||||
workItemNo: 'DOCUMENT:4210022658', sourceSummary: { filename: '4210022658.pdf', documentId: 2658 },
|
||||
userStatus: 'completed', status: 'completed', uiState: { status: 'completed', stage: 'completed' },
|
||||
} as any;
|
||||
const completedB = {
|
||||
workItemNo: 'DOCUMENT:4210022657', sourceSummary: { filename: '4210022657.pdf', documentId: 2657 },
|
||||
userStatus: 'completed', status: 'completed', uiState: { status: 'completed', stage: 'completed' },
|
||||
} as any;
|
||||
const processing = {
|
||||
workItemNo: 'DOCUMENT:4210022656', sourceSummary: { filename: '4210022656.pdf', documentId: 2656 },
|
||||
userStatus: 'running', status: 'processing', uiState: { status: 'processing', stage: 'freight_upload' },
|
||||
} as any;
|
||||
// 模拟热更新前/兼容后端仍把三份 PDF 放在 completed EML 根行的真实输入。
|
||||
const mixedTask = {
|
||||
user_task_no: 'INTAKE:SNI-HOXIN', title: 'NEW PO HOXIN.eml', file_count: 3,
|
||||
userGroup: 'completed', group: 'completed',
|
||||
aggregateChildren: [completedA, completedB, processing],
|
||||
aggregateSummary: { intakeNo: 'SNI-HOXIN', total: 3, completed: 2, processing: 1, needsAction: 0, failed: 0, stages: [], reasonCodes: [] },
|
||||
} as any;
|
||||
const wrapper = mount(ShippingOrderExtractionCard, {
|
||||
props: { state: buildState() },
|
||||
global: { plugins: [i18n], provide: { [SHIPPING_WORKFLOW_KEY as symbol]: {
|
||||
processing: ref({ status_groups: { failed: [], waiting_human: [], processing: [], completed: [mixedTask], cancelled: [], archived: [] } }),
|
||||
processingWorkItems: ref([]),
|
||||
} } },
|
||||
});
|
||||
|
||||
const completedSection = wrapper.findAll('[data-testid="shipping-order-extraction-status-groups"] section')
|
||||
.find((section) => section.text().includes('已完成'))!;
|
||||
await completedSection.get('button').trigger('click');
|
||||
await wrapper.get('[data-testid="shipping-order-extraction-eml-completed-INTAKE:SNI-HOXIN"] button').trigger('click');
|
||||
|
||||
expect(wrapper.get('[data-testid="shipping-order-extraction-eml-completed-INTAKE:SNI-HOXIN"]').text()).toContain('2 个文件');
|
||||
expect(wrapper.get('[data-testid="shipping-order-extraction-eml-completed-INTAKE:SNI-HOXIN"]').text()).toContain('4210022658.pdf');
|
||||
expect(wrapper.get('[data-testid="shipping-order-extraction-eml-completed-INTAKE:SNI-HOXIN"]').text()).not.toContain('4210022656.pdf');
|
||||
expect(wrapper.get('[data-testid="shipping-order-extraction-eml-processing-INTAKE:SNI-HOXIN"]').text()).toContain('4210022656.pdf');
|
||||
});
|
||||
|
||||
it('does not supplement an authoritative EML group from a second work-item snapshot', async () => {
|
||||
const child = {
|
||||
workItemType: 'order_task', workItemNo: 'OT-FALLBACK-1', sourceType: 'eml', rootOrderTaskNo: 'OT-FALLBACK',
|
||||
@@ -347,8 +387,8 @@ describe('ShippingOrderExtractionCard', () => {
|
||||
});
|
||||
|
||||
expect(wrapper.text()).toContain('共 2 个文件');
|
||||
// 关键断言:待人工处理不是完成,聊天摘要必须与批次中心 completed_files 同口径。
|
||||
expect(wrapper.text()).toContain('0/2 已处理');
|
||||
// 关键断言:待人工处理不是完成,头部按状态计数显示"待人工",不显示完成的"已处理"。
|
||||
expect(wrapper.text()).toContain('待人工 2');
|
||||
expect(wrapper.text()).not.toContain('共 6 个文件');
|
||||
expect(wrapper.text()).not.toContain('stale.pdf');
|
||||
});
|
||||
@@ -407,7 +447,7 @@ describe('ShippingOrderExtractionCard', () => {
|
||||
|
||||
// 关键断言:有权威会话投影时,只能显示附件总数,禁止回退历史邮件任务数。
|
||||
expect(wrapper.text()).toContain('共 30 个文件');
|
||||
expect(wrapper.text()).toContain('0/30 已处理');
|
||||
expect(wrapper.text()).toContain('待人工 30');
|
||||
expect(wrapper.text()).not.toContain('共 18 个文件');
|
||||
});
|
||||
|
||||
@@ -419,7 +459,8 @@ describe('ShippingOrderExtractionCard', () => {
|
||||
props: { state: buildState(), runNo: 'SNER-COUNT' },
|
||||
global: { plugins: [i18n], provide: { [SHIPPING_WORKFLOW_KEY as symbol]: { processing: ref({ status_groups: { failed: [], waiting_human: [], processing: [task], completed: [], cancelled: [], archived: [] } }), processingWorkItems: ref([]) } } },
|
||||
});
|
||||
expect(wrapper.text()).toContain('2 个文件');
|
||||
// 状态分组标题必须按两个 PDF 附件计数,不能按一个 EML 容器计为“1 个任务”。
|
||||
expect(wrapper.get('[data-testid="shipping-order-extraction-status-groups"]').text()).toContain('系统处理中 · 2 个文件');
|
||||
});
|
||||
|
||||
it('renders every projected file when the batch has two documents', () => {
|
||||
@@ -598,7 +639,7 @@ describe('ShippingOrderExtractionCard', () => {
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
// 关键断言:对话卡只保留摘要标题与系统处理中状态。
|
||||
expect(wrapper.text()).toContain('订单识别任务');
|
||||
expect(wrapper.text()).toContain('本次订单文件处理');
|
||||
expect(wrapper.text()).toContain('3 个文件');
|
||||
expect(wrapper.text()).toContain('系统处理中');
|
||||
expect(wrapper.text()).toContain('处理时间偏长');
|
||||
@@ -612,6 +653,21 @@ describe('ShippingOrderExtractionCard', () => {
|
||||
expect(wrapper.findAll('[data-testid="shipping-order-document-result"]').length).toBe(0);
|
||||
}, 30_000);
|
||||
|
||||
it('keeps file row copy identical when routed through the shared stage key', () => {
|
||||
const wrapper = mount(ShippingOrderExtractionCard, {
|
||||
props: {
|
||||
state: buildState({
|
||||
documents: [
|
||||
{ unitId: 21, documentId: 21, intakeId: 21, documentType: 'attachment', fileName: 'layout.pdf', status: 'processing', userVisibleStage: 'layout_parsing_started' },
|
||||
],
|
||||
}),
|
||||
},
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
// 输出不变契约:rowStatusLabel 改走共享 key 出口后,文案仍为 UserStage 短语。
|
||||
expect(wrapper.text()).toContain('正在解析版面');
|
||||
}, 30_000);
|
||||
|
||||
it('renders duplicate-linked notice when only open_existing results remain', () => {
|
||||
const wrapper = mount(ShippingOrderExtractionCard, {
|
||||
props: {
|
||||
@@ -635,7 +691,7 @@ describe('ShippingOrderExtractionCard', () => {
|
||||
},
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
expect(wrapper.text()).toContain('订单识别任务');
|
||||
expect(wrapper.text()).toContain('本次订单文件处理');
|
||||
expect(wrapper.text()).toContain('已关联已有任务');
|
||||
expect(wrapper.text()).not.toContain('需人工处理');
|
||||
});
|
||||
@@ -876,4 +932,237 @@ describe('ShippingOrderExtractionCard', () => {
|
||||
expect(details.exists()).toBe(false);
|
||||
expect(wrapper.findAll('[data-testid="shipping-order-extraction-primary-action"]').length).toBe(0);
|
||||
});
|
||||
|
||||
it('uses the submitted_files (batch-size) count for the header chip, not the recognized total', () => {
|
||||
// [回归] 提交基主计数 submitted_files=1 优先于已识别 total_files=3 作为「共 N 个文件」。
|
||||
const wrapper = mount(ShippingOrderExtractionCard, {
|
||||
props: { state: buildState() },
|
||||
global: {
|
||||
plugins: [i18n],
|
||||
provide: {
|
||||
[SHIPPING_WORKFLOW_KEY as symbol]: {
|
||||
processing: ref({
|
||||
ui_state: { status: 'running' },
|
||||
summary: { total_files: 3, submitted_files: 1 },
|
||||
status_groups: {
|
||||
failed: [], waiting_human: [], processing: [
|
||||
{ user_task_no: 'INTAKE:SNI-BATCH', title: 'batch.eml', file_count: 3,
|
||||
userGroup: 'processing', group: 'processing', aggregateChildren: [] },
|
||||
], completed: [], cancelled: [], archived: [],
|
||||
},
|
||||
}),
|
||||
processingWorkItems: ref([]),
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(wrapper.get('[data-testid="shipping-order-extraction-open-batch-workbench"]').exists()).toBe(true);
|
||||
expect(wrapper.text()).toContain('共 1 个文件');
|
||||
});
|
||||
|
||||
it('shows the recognized count inside the file-count chip during the pre-materialization window', () => {
|
||||
// [回归] 识别进度必须与「共 N 个文件」同一标签展示,不能单独占一行。
|
||||
const wrapper = mount(ShippingOrderExtractionCard, {
|
||||
props: { state: buildState() },
|
||||
global: {
|
||||
plugins: [i18n],
|
||||
provide: {
|
||||
[SHIPPING_WORKFLOW_KEY as symbol]: {
|
||||
processing: ref({
|
||||
ui_state: { status: 'running' },
|
||||
summary: { total_files: 0, submitted_files: 1 },
|
||||
status_groups: {
|
||||
failed: [], waiting_human: [], processing: [], completed: [], cancelled: [], archived: [],
|
||||
},
|
||||
}),
|
||||
processingWorkItems: ref([]),
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(wrapper.get('[data-testid="shipping-order-extraction-recognizing-placeholder"]').text()).toContain('正在识别附件');
|
||||
expect(wrapper.text()).toContain('共 1 个文件 · 已识别 0/1');
|
||||
expect(wrapper.find('[data-testid="shipping-order-extraction-recognized-hint"]').exists()).toBe(false);
|
||||
});
|
||||
|
||||
it('renders an unrecognized plan attachment as a distinct pending row inside the EML task', async () => {
|
||||
// [回归] 批次「已识别 1/2」时 EML 列表须展示全部计划附件(含未识别行),
|
||||
// 未识别行标记为「待识别」,便于排查「为什么这份没识别」。
|
||||
const wrapper = mount(ShippingOrderExtractionCard, {
|
||||
props: { state: buildState() },
|
||||
global: {
|
||||
plugins: [i18n],
|
||||
provide: {
|
||||
[SHIPPING_WORKFLOW_KEY as symbol]: {
|
||||
processing: ref({
|
||||
ui_state: { status: 'running' },
|
||||
summary: { total_files: 1, submitted_files: 2 },
|
||||
status_groups: {
|
||||
failed: [], waiting_human: [], processing: [{
|
||||
user_task_no: 'INTAKE:SNI-UNRECOGNIZED', title: 'batch.eml', file_count: 2,
|
||||
userGroup: 'processing', group: 'processing',
|
||||
aggregateChildren: [
|
||||
{
|
||||
workItemNo: 'DOC-10', sourceType: 'eml', intakeNo: 'SNI-UNRECOGNIZED',
|
||||
sourceSummary: { filename: 'F91D1.pdf', documentId: 10 },
|
||||
userStatus: 'waiting_human', userStage: 'order_review', status: 'waiting_human',
|
||||
},
|
||||
{
|
||||
workItemNo: 'PLAN:SNI-UNRECOGNIZED:f92', sourceType: 'eml', intakeNo: 'SNI-UNRECOGNIZED',
|
||||
sourceSummary: { filename: 'F92.pdf' },
|
||||
userStatus: 'processing', userStage: 'intake_parse', status: 'processing',
|
||||
facts: { recognized: false, planState: 'selected_pending' },
|
||||
},
|
||||
],
|
||||
}], completed: [], cancelled: [], archived: [],
|
||||
},
|
||||
}),
|
||||
processingWorkItems: ref([]),
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
await wrapper.get('[data-testid="shipping-order-extraction-eml-processing-INTAKE:SNI-UNRECOGNIZED"] button').trigger('click');
|
||||
const status = wrapper.find('[data-testid="shipping-order-extraction-child-status-PLAN:SNI-UNRECOGNIZED:f92"]');
|
||||
expect(status.exists()).toBe(true);
|
||||
expect(status.text()).toContain('待识别');
|
||||
expect(wrapper.text()).toContain('F92.pdf');
|
||||
expect(wrapper.text()).toContain('尚未识别');
|
||||
});
|
||||
|
||||
it('marks unrecognized Excel attachments as ignored instead of pending recognition', async () => {
|
||||
const wrapper = mount(ShippingOrderExtractionCard, {
|
||||
props: { state: buildState() },
|
||||
global: {
|
||||
plugins: [i18n],
|
||||
provide: {
|
||||
[SHIPPING_WORKFLOW_KEY as symbol]: {
|
||||
processing: ref({
|
||||
ui_state: { status: 'running' },
|
||||
summary: { total_files: 1, submitted_files: 2 },
|
||||
status_groups: {
|
||||
failed: [], waiting_human: [], processing: [{
|
||||
user_task_no: 'INTAKE:SNI-EXCEL', title: 'batch.eml', file_count: 2,
|
||||
userGroup: 'processing', group: 'processing',
|
||||
aggregateChildren: [
|
||||
{
|
||||
workItemNo: 'DOC-11', sourceType: 'eml', intakeNo: 'SNI-EXCEL',
|
||||
sourceSummary: { filename: 'order.pdf', documentId: 11 },
|
||||
userStatus: 'processing', userStage: 'intake_parse', status: 'processing',
|
||||
},
|
||||
{
|
||||
workItemNo: 'PLAN:SNI-EXCEL:report', sourceType: 'eml', intakeNo: 'SNI-EXCEL',
|
||||
sourceSummary: { filename: 'report.xlsx' },
|
||||
userStatus: 'processing', userStage: 'intake_parse', status: 'processing',
|
||||
facts: { recognized: false, planState: 'selected_pending' },
|
||||
},
|
||||
],
|
||||
}], completed: [], cancelled: [], archived: [],
|
||||
},
|
||||
}),
|
||||
processingWorkItems: ref([]),
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
await wrapper.get('[data-testid="shipping-order-extraction-eml-processing-INTAKE:SNI-EXCEL"] button').trigger('click');
|
||||
|
||||
const processingCard = wrapper.get('[data-testid="shipping-order-extraction-eml-processing-INTAKE:SNI-EXCEL"]');
|
||||
expect(processingCard.text()).toContain('order.pdf');
|
||||
expect(processingCard.text()).not.toContain('report.xlsx');
|
||||
expect(wrapper.find('[data-testid="shipping-order-extraction-eml-ignored-INTAKE:SNI-EXCEL"]').exists()).toBe(false);
|
||||
const ignoredSection = wrapper.findAll('[data-testid="shipping-order-extraction-status-groups"] section')
|
||||
.find((section) => section.text().includes('已忽略'))!;
|
||||
await ignoredSection.get('button').trigger('click');
|
||||
const ignoredCard = wrapper.get('[data-testid="shipping-order-extraction-eml-ignored-INTAKE:SNI-EXCEL"]');
|
||||
const status = ignoredCard.get('[data-testid="shipping-order-extraction-child-status-PLAN:SNI-EXCEL:report"]');
|
||||
expect(status.text()).toContain('已忽略');
|
||||
expect(ignoredCard.text()).toContain('非订单 PDF,不参与订单识别');
|
||||
expect(status.text()).not.toContain('待识别');
|
||||
});
|
||||
|
||||
it('completes the header when only ignored Excel attachments remain', () => {
|
||||
const completedPdf = {
|
||||
workItemNo: 'DOC-COMPLETED', sourceType: 'eml', intakeNo: 'SNI-HEADER-COMPLETE',
|
||||
sourceSummary: { filename: 'order.pdf', documentId: 12 },
|
||||
userStatus: 'completed', userStage: 'intake_parse', status: 'completed',
|
||||
};
|
||||
const ignoredExcel = {
|
||||
workItemNo: 'PLAN:SNI-HEADER-COMPLETE:excel', sourceType: 'eml', intakeNo: 'SNI-HEADER-COMPLETE',
|
||||
sourceSummary: { filename: 'PO_INFO.xlsx' },
|
||||
userStatus: 'processing', userStage: 'intake_parse', status: 'processing',
|
||||
facts: { recognized: false, planState: 'selected_pending' },
|
||||
};
|
||||
const task = (children: unknown[]) => ({
|
||||
user_task_no: 'INTAKE:SNI-HEADER-COMPLETE', title: 'batch.eml', file_count: 1,
|
||||
userGroup: 'processing', group: 'processing', aggregateChildren: children,
|
||||
});
|
||||
const wrapper = mount(ShippingOrderExtractionCard, {
|
||||
props: { state: buildState() },
|
||||
global: {
|
||||
plugins: [i18n],
|
||||
provide: {
|
||||
[SHIPPING_WORKFLOW_KEY as symbol]: {
|
||||
processing: ref({
|
||||
ui_state: { status: 'running', lifecycleStage: 'intake_parse' },
|
||||
summary: { total_files: 1, submitted_files: 2 },
|
||||
status_groups: {
|
||||
failed: [], waiting_human: [], processing: [task([ignoredExcel])],
|
||||
completed: [task([completedPdf])], cancelled: [], archived: [],
|
||||
},
|
||||
}),
|
||||
processingWorkItems: ref([]),
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper.text()).toContain('本次订单文件处理');
|
||||
expect(wrapper.text()).toContain('订单文件 1 个已完成 · 1 个已忽略');
|
||||
expect(wrapper.text()).toContain('处理完成');
|
||||
expect(wrapper.text()).not.toContain('系统处理中');
|
||||
expect(wrapper.text()).not.toContain('当前阶段:');
|
||||
expect(wrapper.findAll('.animate-spin')).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('keeps the header processing when an unrecognized PDF remains', () => {
|
||||
const unrecognizedPdf = {
|
||||
workItemNo: 'PLAN:SNI-HEADER-PENDING:pdf', sourceType: 'eml', intakeNo: 'SNI-HEADER-PENDING',
|
||||
sourceSummary: { filename: 'PO_INFO.pdf' },
|
||||
userStatus: 'processing', userStage: 'intake_parse', status: 'processing',
|
||||
facts: { recognized: false, planState: 'selected_pending' },
|
||||
};
|
||||
const ignoredExcel = {
|
||||
workItemNo: 'PLAN:SNI-HEADER-PENDING:excel', sourceType: 'eml', intakeNo: 'SNI-HEADER-PENDING',
|
||||
sourceSummary: { filename: 'PO_INFO.xlsx' },
|
||||
userStatus: 'processing', userStage: 'intake_parse', status: 'processing',
|
||||
facts: { recognized: false, planState: 'selected_pending' },
|
||||
};
|
||||
const wrapper = mount(ShippingOrderExtractionCard, {
|
||||
props: { state: buildState() },
|
||||
global: {
|
||||
plugins: [i18n],
|
||||
provide: {
|
||||
[SHIPPING_WORKFLOW_KEY as symbol]: {
|
||||
processing: ref({
|
||||
ui_state: { status: 'running', lifecycleStage: 'intake_parse' },
|
||||
summary: { total_files: 1, submitted_files: 2 },
|
||||
status_groups: {
|
||||
failed: [], waiting_human: [], processing: [{
|
||||
user_task_no: 'INTAKE:SNI-HEADER-PENDING', title: 'batch.eml', file_count: 1,
|
||||
userGroup: 'processing', group: 'processing', aggregateChildren: [unrecognizedPdf, ignoredExcel],
|
||||
}], completed: [], cancelled: [], archived: [],
|
||||
},
|
||||
}),
|
||||
processingWorkItems: ref([]),
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper.text()).toContain('系统处理中');
|
||||
expect(wrapper.text()).toContain('共 2 个文件 · 已识别 1/2 · 1 个已忽略');
|
||||
expect(wrapper.text()).not.toContain('当前阶段:');
|
||||
expect(wrapper.findAll('.animate-spin')).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
@@ -143,12 +143,41 @@ describe('ShippingWorkflowTimeline', () => {
|
||||
expect(progress.text()).toContain('货代上传');
|
||||
expect(progress.findAll('button')).toHaveLength(5);
|
||||
const upload = wrapper.get('[data-testid="shipping-workflow-stage-filter-freight_upload"]');
|
||||
// 五阶段卡仅保留阶段名和后端统计数量,状态由卡片样式表达。
|
||||
expect(upload.text()).toBe('货代上传1');
|
||||
// 阶段摘要以服务端计数的最高关注状态呈现,而非仅显示文件数量。
|
||||
expect(upload.text()).toBe('货代上传1 待处理');
|
||||
await upload.trigger('click');
|
||||
expect(wrapper.find('[data-testid="shipping-workflow-download-toolbar"]').exists()).toBe(true);
|
||||
});
|
||||
|
||||
it('separates ignored Excel attachments from order-file progress totals', async () => {
|
||||
const ignoredExcel = fileProjection({
|
||||
workItemNo: 'PLAN:EML-EXCEL:report',
|
||||
sourceType: 'eml',
|
||||
sourceSummary: {
|
||||
emailSubject: null, filename: 'report.xlsx', documentId: null, documentCount: 0,
|
||||
parsedDocumentCount: 0, candidateCount: 0, customerName: null, poNumber: null,
|
||||
},
|
||||
facts: { recognized: false },
|
||||
});
|
||||
const task = {
|
||||
user_task_no: 'INTAKE:EML-EXCEL', group: 'processing', status_label: 'extracting', title: 'mail.eml',
|
||||
display_kind: 'aggregate', document_names: ['order.pdf', 'report.xlsx'], file_count: 2,
|
||||
run_no: 'RUN-EML-EXCEL', can_append: false, aggregateChildren: [ignoredExcel],
|
||||
};
|
||||
const processing = processingProjection({
|
||||
summary: {
|
||||
total_tasks: 1, total_files: 5, submitted_files: 6, processing: 1, needs_action: 1,
|
||||
completed: 3, history: 0, processing_files: 1, completed_files: 3, waiting_human_files: 1, failed_files: 0,
|
||||
},
|
||||
status_groups: { failed: [], waiting_human: [], processing: [task], completed: [], cancelled: [], archived: [] },
|
||||
} as Partial<ConversationProcessingProjection>);
|
||||
const wrapper = mountTimeline(processing, [ignoredExcel]);
|
||||
await flushPromises();
|
||||
|
||||
expect(wrapper.get('[data-testid="shipping-workflow-overview"]').text()).toContain('已忽略1');
|
||||
expect(wrapper.get('[data-testid="shipping-workflow-overview-progress"]').text()).toContain('3/5 个订单文件已处理 · 1 个文件已忽略');
|
||||
});
|
||||
|
||||
it('removes the obsolete file-detail drawer and expand entry from batch workbench', async () => {
|
||||
const wrapper = mountTimeline(processingProjection(), [fileProjection()]);
|
||||
await flushPromises();
|
||||
|
||||
Reference in new issue
Block a user