discourse/test/javascripts/integration/login-required-test.js.es6
Robin Ward 7aa68eaeab Rename "Integration" tests to "Acceptance" tests.
The term "Acceptance" seems to have won out everywhere and I don't want
our codebase to be confusing.
2015-04-06 14:14:00 -04:00

44 lines
1,007 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");
});
click('#search-button');
andThen(() => {
ok(exists('.login-modal'), "clicking search opens the login modal");
});
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");
});
});