This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/tests/acceptance/bootstrap-mode-notice-test.js
Arpit Jalan 10a1b6b0a9
FEATURE: update bootstrap mode notice to add invite and wizard links (#17822)
* FEATURE: update bootstrap mode notice to add invite and wizard links

* Updates per feedback on PR

* Fix the wizard link not showing

* Remove unneeded function

* Remove router service injection
2022-08-10 00:13:42 +05:30

44 lines
1.1 KiB
JavaScript

import { acceptance, exists } from "discourse/tests/helpers/qunit-helpers";
import { test } from "qunit";
import { click, currentURL, visit } from "@ember/test-helpers";
acceptance("Bootstrap Mode Notice", function (needs) {
needs.user();
needs.site({ wizard_required: true });
needs.settings({
bootstrap_mode_enabled: true,
bootstrap_mode_min_users: 50,
});
test("Navigation", async function (assert) {
await visit("/");
assert.ok(
exists(".bootstrap-mode-notice"),
"has the bootstrap mode notice"
);
assert.ok(
exists(".bootstrap-invite-button"),
"bootstrap notice has invite button"
);
assert.ok(
exists(".bootstrap-wizard-link"),
"bootstrap notice has wizard link"
);
await click(".bootstrap-invite-button");
assert.strictEqual(
currentURL(),
"/u/eviltrout/invited/pending",
"it transitions to the invite page"
);
await visit("/");
await click(".bootstrap-wizard-link");
assert.strictEqual(
currentURL(),
"/wizard/steps/hello-world",
"it transitions to the wizard page"
);
});
});