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

45 lines
1020 B
Plaintext
Raw Normal View History

import { acceptance } from "helpers/qunit-helpers";
acceptance("Login Required", {
2014-07-31 18:07:04 -04:00
settings: {
login_required: true
}
});
test("redirect", () => {
2014-07-31 18:07:04 -04:00
visit('/latest');
andThen(() => {
2014-07-31 18:07:04 -04:00
equal(currentPath(), "login", "it redirects them to login");
});
click('#site-logo');
andThen(() => {
2014-07-31 18:07:04 -04:00
equal(currentPath(), "login", "clicking the logo keeps them on login");
});
click('header .login-button');
andThen(() => {
2014-07-31 18:07:04 -04:00
ok(exists('.login-modal'), "they can still access the login modal");
});
2015-03-26 07:09:30 -04:00
click('.modal-header .close');
andThen(() => {
ok(invisible('.login-modal'), "it closes the login modal");
});
click('#search-button');
andThen(() => {
ok(exists('.login-modal'), "clicking search opens the login modal");
});
2015-03-26 07:09:30 -04:00
click('.modal-header .close');
andThen(() => {
ok(invisible('.login-modal'), "it closes the login modal");
});
click('#toggle-hamburger-menu');
andThen(() => {
ok(exists('.login-modal'), "site map opens the login modal");
});
2014-07-31 18:07:04 -04:00
});