1
0
mirror of synced 2026-08-05 14:47:03 +00:00

abstract out the stripe component for easy future testing

This commit is contained in:
Rimian Perkins
2019-08-28 14:59:45 +10:00
parent f1de907c32
commit 8d8e9f9ad1
9 changed files with 120 additions and 187 deletions
@@ -5,10 +5,12 @@ moduleForComponent("donation-form", { integration: true });
componentTest("donation form has content", {
template: `{{donation-form}}`,
beforeEach() {
this.registry.register('component:stripe-card', Ember.Component.extend({ tagName: 'dummy-component-tag' }));
},
async test(assert) {
assert.ok(find('#payment-form').length, 'The form renders');
assert.equal(find('.discourse-donations-cause .selected-name')
.text()
.trim(), 'Select a cause', 'It has the combo box');
assert.ok(find('#payment-form').length, "The form renders");
assert.ok(find('dummy-component-tag').length, "The stripe component renders");
}
});
@@ -6,9 +6,9 @@ componentTest("donation-row", {
template: `{{donation-row currency=3 amount=21 period='monthly'}}`,
test(assert) {
assert.equal(find(".donation-row-currency").text(), "3");
assert.equal(find(".donation-row-amount").text(), "21");
assert.equal(find(".donation-row-period").text(), "monthly");
assert.equal(find(".donation-row-currency").text(), "3", "It has currency");
assert.equal(find(".donation-row-amount").text(), "21", "It has an amount");
assert.equal(find(".donation-row-period").text(), "monthly", "It has a period");
}
});
@@ -21,6 +21,6 @@ componentTest("donation-row cancels subscription", {
},
async test(assert) {
assert.ok(find(".donation-row-subscription").length);
assert.ok(find(".donation-row-subscription").length, "It has a subscription");
}
});