Skip to content

Commit fa08c57

Browse files
authored
Fix discount in billing UI (#497)
* Fix discount in billing UI * Remove npm test workflow for now
1 parent 4c9fb08 commit fa08c57

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

assets/src/components/billing/support.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,12 @@ describe('calculateSubscriptionDiscount', () => {
202202
discount: {
203203
duration: 'forever',
204204
name: 'Early Adopter',
205-
percent_off: 50,
205+
percent_off: 40,
206206
valid: true,
207207
},
208208
});
209209

210-
expect(calculateSubscriptionDiscount(subscription)).toEqual(2000);
210+
expect(calculateSubscriptionDiscount(subscription)).toEqual(1600);
211211
});
212212

213213
test('handles amount_off discounts', () => {
@@ -230,6 +230,6 @@ describe('calculateSubscriptionDiscount', () => {
230230
},
231231
});
232232

233-
expect(calculateSubscriptionDiscount(subscription)).toEqual(3000);
233+
expect(calculateSubscriptionDiscount(subscription)).toEqual(1000);
234234
});
235235
});

assets/src/components/billing/support.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export const calculateSubscriptionDiscount = (
198198
}
199199

200200
if (amountOff) {
201-
return total - amountOff;
201+
return amountOff;
202202
} else if (percentOff) {
203203
return total * (percentOff / 100);
204204
} else {

0 commit comments

Comments
 (0)