discourse/test/javascripts/acceptance/login-required-test.js.es6

30 lines
647 B
JavaScript

import { acceptance } from "helpers/qunit-helpers";
acceptance("Login Required", {
settings: {
login_required: true
}
});
test("redirect", () => {
visit('/latest');
andThen(() => {
equal(currentPath(), "login", "it redirects them to login");
});
click('#site-logo');
andThen(() => {
equal(currentPath(), "login", "clicking the logo keeps them on login");
});
click('header .login-button');
andThen(() => {
ok(exists('.login-modal'), "they can still access the login modal");
});
click('.modal-header .close');
andThen(() => {
ok(invisible('.login-modal'), "it closes the login modal");
});
});