discourse-subscriptions/test/javascripts/components/stripe-card-test.js.es6

32 lines
687 B
Plaintext
Raw Normal View History

2019-09-11 19:25:06 -04:00
import componentTest from "helpers/component-test";
2019-12-02 19:00:03 -05:00
import { stubStripe } from "discourse/plugins/discourse-subscriptions/helpers/stripe";
2019-09-11 19:25:06 -04:00
moduleForComponent("stripe-card", { integration: true });
componentTest("Discourse Patrons stripe card success", {
2019-09-12 04:51:40 -04:00
template: `{{stripe-card handleConfirmStripeCard=onSubmit billing=billing}}`,
2019-09-11 19:25:06 -04:00
beforeEach() {
2019-10-08 20:53:58 -04:00
stubStripe();
2019-09-12 04:51:40 -04:00
this.set(
"billing",
Ember.Object.create({
name: "",
email: "",
phone: ""
})
);
2019-09-11 19:25:06 -04:00
},
async test(assert) {
assert.expect(1);
this.set("onSubmit", () => {
assert.ok(true, "payment method created");
});
await click(".btn-payment");
}
});