FEATURE: add user opt to select bookmarks as home (#10597)

Admins can currently add the bookmarks discovery route link
to the homepage interface, but users can't presently select
that as their default home view.  This change facilitates that,
adding the option to the existing Default Home Page dropdown on
the User Preferences Interface page.
This commit is contained in:
Robert
2020-09-10 16:13:12 +01:00
committed by GitHub
parent 5a34c7cc9e
commit dee451605b
6 changed files with 289 additions and 9 deletions
@@ -427,3 +427,33 @@ QUnit.test("can select an option from a dropdown", async (assert) => {
await field.selectRowByValue("Cat");
assert.equal(field.header().value(), "Cat", "it sets the value of the field");
});
acceptance(
"User Preferences, selecting bookmarks discovery as user's default homepage",
{
loggedIn: true,
settings: {
top_menu: "categories|latest|top|bookmarks",
},
}
);
QUnit.test(
"selecting bookmarks as home directs home to bookmarks",
async (assert) => {
await visit("/u/eviltrout/preferences/interface");
assert.ok(exists(".home .combo-box"), "it has a home selector combo-box");
const field = selectKit(".home .combo-box");
await field.expand();
await field.selectRowByValue("6");
await click(".save-changes");
await visit("/");
assert.ok(exists(".topic-list"), "The list of topics was rendered");
assert.equal(
currentPath(),
"discovery.bookmarks",
"it navigates to bookmarks"
);
}
);