discourse-subscriptions/test/javascripts/components/payment-options-test.js.es6

37 lines
869 B
Plaintext
Raw Normal View History

2019-12-05 21:52:03 -05:00
import componentTest from "helpers/component-test";
moduleForComponent("payment-options", { integration: true });
componentTest("Discourse Subscriptions has no plans", {
template: `{{payment-options plans=plans}}`,
async test(assert) {
this.set('plans', false);
assert.equal(
find("#subscribe-buttons .btn-discourse-subscriptions-subscribe").length,
0,
"The plan buttons are not shown"
);
}
});
componentTest("Discourse Subscriptions has content", {
template: `{{payment-options plans=plans}}`,
async test(assert) {
this.set('plans', [1, 2]);
assert.equal(
find("#subscribe-buttons .btn-discourse-subscriptions-subscribe").length,
2,
"The plan buttons are shown"
);
assert.equal(
find("#subscribe-buttons .btn-primary").length,
0,
"The none are selected"
);
}
});