feat(subscription): highlight popular plans

This commit is contained in:
2026-07-15 18:30:18 +08:00
parent c37a2f9040
commit 7dce1b5d4c
10 changed files with 157 additions and 14 deletions
@@ -232,6 +232,24 @@ describe("subscription screen helpers", () => {
).toBeNull();
});
it("maps the backend most popular flag to VIP and coin views", () => {
const popularVip = toVipOfferPlanViews([
makePlan({ planId: "vip_monthly", mostPopular: true }),
]);
const popularCoins = toCoinsOfferPlanViews([
makePlan({
planId: "coin_1000",
orderType: "coins_1000",
vipDays: null,
dolAmount: 1000,
mostPopular: true,
}),
]);
expect(popularVip[0]?.mostPopular).toBe(true);
expect(popularCoins[0]?.mostPopular).toBe(true);
});
it("maps normal VIP original price outside first recharge activity", () => {
expect(
toVipOfferPlanViews([