feat(shipping-notice): 落地 XFA 拆分、版面签名、统一进度与处理域履约

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hugoandCursor committed 2026-08-06 10:18:37 +08:00
1 parent 3a9fbac2fc
commit d2b3d74def
571 files changed
+78064 -24681

No files matched your search

@@ -0,0 +1,40 @@
/**
* features/chat/shipping/shippingProcessingLabels.spec.ts
* 用途:验收统一状态文案映射到 chat.shippingProcessing。
* 依赖:Vitest、shippingProcessingLabels。
*/
import { describe, expect, it } from 'vitest';
import {
resolveShippingProcessingMessage,
resolveShippingProcessingStatusLabel,
shippingProcessingStatusKey,
} from './shippingProcessingLabels';
describe('shippingProcessingLabels', () => {
it('bridges pending_review to waiting_review key', () => {
expect(shippingProcessingStatusKey('pending_review')).toBe(
'chat.shippingProcessing.status.waiting_review',
);
});
it('falls back to shippingProcessing.taskStatus when unified status missing', () => {
// 关键断言:旧 taskStatus 已合并进 shippingProcessing。
const te = (key: string) => key === 'chat.shippingProcessing.taskStatus.queued';
const t = (key: string) => (key.endsWith('queued') ? '排队中' : key);
expect(resolveShippingProcessingStatusLabel('queued', te, t)).toBe('排队中');
});
it('uses unified label when available', () => {
const te = (key: string) => key === 'chat.shippingProcessing.status.waiting_review';
const t = (key: string) => (key.includes('waiting_review') ? '待复核' : key);
expect(resolveShippingProcessingStatusLabel('pending_review', te, t)).toBe('待复核');
});
it('resolves group messages from shippingProcessing', () => {
const te = (key: string) => key === 'chat.shippingProcessing.groupNeedsAction';
const t = (key: string, params?: Record<string, unknown>) => (
key.includes('groupNeedsAction') ? `需要你处理 · ${params?.count}` : key
);
expect(resolveShippingProcessingMessage('groupNeedsAction', te, t, { count: 2 })).toBe('需要你处理 · 2');
});
});