1
0
mirror of synced 2026-08-04 06:06:55 +00:00

initial payment buttons component

This commit is contained in:
Rimian Perkins
2019-12-06 13:52:03 +11:00
parent 2c1eb9b22b
commit 2ce314fc8d
8 changed files with 81 additions and 10 deletions
@@ -0,0 +1,36 @@
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"
);
}
});