26 lines
700 B
JavaScript
Raw Normal View History

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