Files
discourse-subscriptions/test/javascripts/components/donation-row-test.js.es6
T

34 lines
875 B
JavaScript
Raw Normal View History

2019-08-27 20:37:20 +10:00
import componentTest from "helpers/component-test";
2019-08-26 17:34:40 +10:00
2019-08-27 20:37:20 +10:00
moduleForComponent("donation-row", { integration: true });
2019-08-26 17:34:40 +10:00
2019-08-27 20:37:20 +10:00
componentTest("donation-row", {
2019-08-26 17:34:40 +10:00
template: `{{donation-row currency=3 amount=21 period='monthly'}}`,
test(assert) {
assert.equal(find(".donation-row-currency").text(), "3", "It has currency");
assert.equal(find(".donation-row-amount").text(), "21", "It has an amount");
2019-08-28 18:36:19 +10:00
assert.equal(
find(".donation-row-period").text(),
"monthly",
"It has a period"
);
2019-08-27 20:37:20 +10:00
}
2019-08-26 17:34:40 +10:00
});
2019-08-27 20:37:20 +10:00
componentTest("donation-row cancels subscription", {
2019-08-26 17:34:40 +10:00
template: `{{donation-row currentUser=currentUser subscription=subscription}}`,
beforeEach() {
2019-08-27 20:37:20 +10:00
this.set("currentUser", true);
this.set("subscription", true);
2019-08-26 17:34:40 +10:00
},
async test(assert) {
2019-08-28 18:36:19 +10:00
assert.ok(
find(".donation-row-subscription").length,
"It has a subscription"
);
2019-08-27 20:37:20 +10:00
}
2019-08-26 17:34:40 +10:00
});