feat(shipping-notice): 收敛订单处理状态与履约门禁
This commit is contained in:
1 parent
bffcd55b40
commit
70dd0051b8
153 files changed
+10916
-4296
No files matched your search
@@ -17,9 +17,12 @@ import {
|
||||
} from './shippingProcessingLabels';
|
||||
|
||||
describe('shippingProcessingLabels', () => {
|
||||
it('bridges pending_review to waiting_review key', () => {
|
||||
it('maps waiting_human to its own status key (no LEGACY bridge to waiting_review)', () => {
|
||||
expect(shippingProcessingStatusKey('waiting_human')).toBe(
|
||||
'chat.shippingProcessing.status.waiting_human',
|
||||
);
|
||||
expect(shippingProcessingStatusKey('pending_review')).toBe(
|
||||
'chat.shippingProcessing.status.waiting_review',
|
||||
'chat.shippingProcessing.status.pending_review',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -36,10 +39,15 @@ describe('shippingProcessingLabels', () => {
|
||||
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('does not treat dirty pending_review as waiting_review label', () => {
|
||||
const te = (key: string) => key === 'chat.shippingProcessing.status.waiting_review'
|
||||
|| key === 'chat.shippingProcessing.taskStatus.unknown';
|
||||
const t = (key: string) => {
|
||||
if (key.includes('waiting_review')) return '待复核';
|
||||
if (key.endsWith('.unknown')) return '状态待确认';
|
||||
return key;
|
||||
};
|
||||
expect(resolveShippingProcessingStatusLabel('pending_review', te, t)).toBe('状态待确认');
|
||||
});
|
||||
|
||||
it('uses the safe unknown label instead of exposing an unrecognized status code', () => {
|
||||
|
||||
Reference in new issue
Block a user