discourse-subscriptions/test/javascripts/models/plan-test.js.es6

28 lines
593 B
Plaintext
Raw Normal View History

2019-10-30 19:44:46 -04:00
import Plan from "discourse/plugins/discourse-patrons/discourse/models/plan";
QUnit.module("discourse-patrons:model:plan");
QUnit.test("subscriptionRate", assert => {
const plan = Plan.create({
amount: 2399,
currency: 'aud',
interval: 'month'
});
assert.equal(
plan.get("subscriptionRate"),
"$23.99 AUD / month",
2019-10-30 20:41:01 -04:00
"it returns the formatted subscription rate"
);
});
QUnit.test("amountDollars", assert => {
const plan = Plan.create({ amount: 2399 });
assert.equal(
plan.get("amountDollars"),
23.99,
"it returns the formatted amount"
2019-10-30 19:44:46 -04:00
);
});