自动修改

This commit is contained in:
2026-07-12 07:50:27 +08:00
parent b74e4e4fe5
commit d0f0fa09af
18 changed files with 117 additions and 66 deletions
+19
View File
@@ -6,6 +6,7 @@ import {
validateRedeemAmount,
allocateBenefitCoupons,
calcBenefitSummary,
orderTabToStatuses,
} from './index';
describe('calcBenefitAmount', () => {
@@ -87,6 +88,24 @@ describe('allocateBenefitCoupons', () => {
});
});
describe('orderTabToStatuses', () => {
it('maps V3.0 three user tabs', () => {
expect(orderTabToStatuses('pending_pay')).toEqual(['PENDING_PAY']);
expect(orderTabToStatuses('paid')).toEqual([
'PENDING_SHIP',
'OUT_WAREHOUSE',
'SHIPPING',
'PENDING_RECEIVE',
]);
expect(orderTabToStatuses('completed')).toEqual(['COMPLETED']);
});
it('keeps legacy tab keys mapped to paid', () => {
expect(orderTabToStatuses('pending_ship')).toEqual(orderTabToStatuses('paid'));
expect(orderTabToStatuses('pending_receive')).toEqual(orderTabToStatuses('paid'));
});
});
describe('calcBenefitSummary', () => {
it('max redeem equals total balance', () => {
expect(calcBenefitSummary([300, 400])).toEqual({