This repository has been archived on 2025-05-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
discourse/test/javascripts/integration/login-required-test.js.es6

45 lines
1,007 B
Text
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 12:09:30 +01: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 12:09:30 +01:00
click('.modal-header .close');
andThen(() => {
ok(invisible('.login-modal'), "it closes the login modal");
});
click('#site-map');
andThen(() => {
ok(exists('.login-modal'), "site map opens the login modal");
});
2014-07-31 18:07:04 -04:00
});