2021-01-04 16:32:33 -03:00
|
|
|
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
2020-01-10 14:41:32 +11:00
|
|
|
import { stubStripe } from "discourse/plugins/discourse-subscriptions/helpers/stripe";
|
2019-10-10 13:52:55 +11:00
|
|
|
|
2021-01-04 16:32:33 -03:00
|
|
|
acceptance("Discourse Subscriptions", function (needs) {
|
|
|
|
needs.user();
|
|
|
|
needs.hooks.beforeEach(() => {
|
2020-01-10 14:41:32 +11:00
|
|
|
stubStripe();
|
2021-01-04 16:32:33 -03:00
|
|
|
});
|
2020-01-10 14:41:32 +11:00
|
|
|
|
2021-01-04 16:32:33 -03:00
|
|
|
test("subscribing", async (assert) => {
|
|
|
|
await visit("/s");
|
2019-10-10 13:52:55 +11:00
|
|
|
|
2021-01-04 16:32:33 -03:00
|
|
|
await click(".product:first-child a");
|
2020-01-10 16:47:28 +11:00
|
|
|
|
2021-01-04 16:32:33 -03:00
|
|
|
assert.ok(
|
|
|
|
$(".discourse-subscriptions-section-columns").length,
|
|
|
|
"has the sections for billing"
|
|
|
|
);
|
2020-01-12 09:08:00 +11:00
|
|
|
|
2021-01-04 16:32:33 -03:00
|
|
|
assert.ok(
|
|
|
|
$(".subscribe-buttons button").length,
|
|
|
|
"has buttons for subscribe"
|
|
|
|
);
|
|
|
|
});
|
2019-10-10 13:52:55 +11:00
|
|
|
});
|