This repository has been archived on 2023-03-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
osr-discourse-src/test/javascripts/acceptance/login-redirect-test.js
T
Robin Ward c4d5c0c91b REFACTOR: Remove Discourse.SiteSettings from utilities
This involves a little refactoring of how our `defaultHomepage()` works.
It previously would check the meta tag / site settings each time it was
called but now it only checks once on application boot.
2020-07-24 09:45:55 -04:00

27 lines
627 B
JavaScript

import { acceptance } from "helpers/qunit-helpers";
acceptance("Login redirect");
QUnit.test("redirects login to default homepage", async function(assert) {
await visit("/login");
assert.equal(
currentPath(),
"discovery.latest",
"it works when latest is the homepage"
);
});
acceptance("Login redirect - categories default", {
settings: {
top_menu: "categories|latest|top|hot"
}
});
QUnit.test("when site setting is categories", async function(assert) {
await visit("/login");
assert.equal(
currentPath(),
"discovery.categories",
"it works when categories is the homepage"
);
});