fix(payment): default nullable first recharge offer
This commit is contained in:
@@ -114,4 +114,22 @@ describe("PaymentPlansResponse", () => {
|
||||
promotionType: "first_recharge_half_price",
|
||||
});
|
||||
});
|
||||
|
||||
it("defaults nullable first recharge offer metadata", () => {
|
||||
const response = PaymentPlansResponse.from({
|
||||
isFirstRecharge: true,
|
||||
firstRechargeOffer: {
|
||||
enabled: null,
|
||||
type: null,
|
||||
discountPercent: null,
|
||||
},
|
||||
plans: [],
|
||||
});
|
||||
|
||||
expect(response.firstRechargeOffer).toEqual({
|
||||
enabled: false,
|
||||
type: "",
|
||||
discountPercent: 0,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user