REFACTOR: Use the new format for acceptance tests. (#37)
This commit is contained in:
@@ -1,17 +1,16 @@
|
||||
import { acceptance } from "helpers/qunit-helpers";
|
||||
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { stubStripe } from "discourse/plugins/discourse-subscriptions/helpers/stripe";
|
||||
|
||||
acceptance("Discourse Subscriptions", {
|
||||
beforeEach() {
|
||||
acceptance("Discourse Subscriptions", function (needs) {
|
||||
needs.user();
|
||||
needs.hooks.beforeEach(() => {
|
||||
stubStripe();
|
||||
},
|
||||
});
|
||||
|
||||
loggedIn: true
|
||||
});
|
||||
test("viewing product page", async (assert) => {
|
||||
await visit("/s");
|
||||
|
||||
QUnit.test("viewing product page", async assert => {
|
||||
await visit("/s");
|
||||
|
||||
assert.ok($(".product-list").length, "has product page");
|
||||
assert.ok($(".product:first-child a").length, "has a link");
|
||||
assert.ok($(".product-list").length, "has product page");
|
||||
assert.ok($(".product:first-child a").length, "has a link");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,23 +1,25 @@
|
||||
import { acceptance } from "helpers/qunit-helpers";
|
||||
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { stubStripe } from "discourse/plugins/discourse-subscriptions/helpers/stripe";
|
||||
|
||||
acceptance("Discourse Subscriptions", {
|
||||
beforeEach() {
|
||||
acceptance("Discourse Subscriptions", function (needs) {
|
||||
needs.user();
|
||||
needs.hooks.beforeEach(() => {
|
||||
stubStripe();
|
||||
},
|
||||
});
|
||||
|
||||
loggedIn: true
|
||||
});
|
||||
test("subscribing", async (assert) => {
|
||||
await visit("/s");
|
||||
|
||||
QUnit.test("subscribing", async assert => {
|
||||
await visit("/s");
|
||||
await click(".product:first-child a");
|
||||
|
||||
await click(".product:first-child a");
|
||||
assert.ok(
|
||||
$(".discourse-subscriptions-section-columns").length,
|
||||
"has the sections for billing"
|
||||
);
|
||||
|
||||
assert.ok(
|
||||
$(".discourse-subscriptions-section-columns").length,
|
||||
"has the sections for billing"
|
||||
);
|
||||
|
||||
assert.ok($(".subscribe-buttons button").length, "has buttons for subscribe");
|
||||
assert.ok(
|
||||
$(".subscribe-buttons button").length,
|
||||
"has buttons for subscribe"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user