Skip to content

Commit

Permalink
Adds spec plans
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
  • Loading branch information
chrissrogers committed Nov 2, 2017
1 parent d1b8dfc commit 9eb79fd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/recurly/pricing/checkout/calculations.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ export default class Calculations {
*/
mostValuableSubscriptionForDiscount () {
if (this.items.subscriptions.length === 0) return;
// FIXME: this needs to be called when applying the trial, not discount
if (this.items.coupon.discount.type === 'free_trial') {
return this.mostValuableSubscriptionForFreeTrial();
} else {
Expand Down
16 changes: 15 additions & 1 deletion test/pricing/checkout/checkout.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,21 @@ describe('CheckoutPricing', function () {
* Coupons - TODO
*/

describe('CheckoutPricing#coupon', () => {});
describe('CheckoutPricing#coupon', () => {
// invalid coupon
// coupon applying only to adjustments
// coupon applying only to plans
// - all plans
// - specific plans
// - on checkout
// - not on checkout
// coupon applying to adjustments and plans
// - all plans
// - specific plan not not checkout
// subscription-level coupon
// - percent, fixed, free trial
// - applies to adjustments, plans, both
});

/**
* address - TODO
Expand Down

0 comments on commit 9eb79fd

Please sign in to comment.