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.1 KiB
Text
Raw Normal View History

2014-07-31 18:07:04 -04:00
integration("Login Required", {
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 17:24:35 +11:00
// TODO Why is this failing, unable to repro this failure
// click('.modal-header .close');
// andThen(() => {
// ok(!exists('.login-modal'), "it closes the login modal");
// });
click('#search-button');
andThen(() => {
ok(exists('.login-modal'), "clicking search opens the login modal");
});
2015-03-26 17:24:35 +11:00
// TODO Why is this failing, unable to repro this failure
// click('.modal-header .close');
// andThen(() => {
// ok(!exists('.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
});