Merge pull request #4849 from discourse/prefs

User preferences in tabs
This commit is contained in:
Neil Lalonde
2017-05-03 16:53:26 -04:00
committed by GitHub
35 changed files with 1085 additions and 695 deletions

View File

@ -6,17 +6,42 @@ test("update some fields", () => {
andThen(() => {
ok($('body.user-preferences-page').length, "has the body class");
equal(currentURL(), '/u/eviltrout/preferences', "it doesn't redirect");
equal(currentURL(), '/u/eviltrout/preferences/account', "defaults to account tab");
ok(exists('.user-preferences'), 'it shows the preferences');
});
fillIn("#edit-location", "Westeros");
const savePreferences = () => {
click('.save-user');
ok(!exists('.saved-user'), "it hasn't been saved yet");
andThen(() => {
ok(exists('.saved-user'), 'it displays the saved message');
});
};
click('.save-user');
ok(!exists('.saved-user'), "it hasn't been saved yet");
andThen(() => {
ok(exists('.saved-user'), 'it displays the saved message');
});
click(".preferences-nav .nav-profile a");
fillIn("#edit-location", "Westeros");
savePreferences();
click(".preferences-nav .nav-emails a");
click(".pref-activity-summary input[type=checkbox]");
savePreferences();
click(".preferences-nav .nav-notifications a");
selectDropdown('.control-group.notifications select.combobox', 1440);
savePreferences();
click(".preferences-nav .nav-categories a");
fillIn('.category-controls .category-selector', 'faq');
savePreferences();
ok(!exists('.preferences-nav .nav-tags a'), "tags tab isn't there when tags are disabled");
// Error: Unhandled request in test environment: /themes/assets/10d71596-7e4e-4dc0-b368-faa3b6f1ce6d?_=1493833562388 (GET)
// click(".preferences-nav .nav-interface a");
// click('.control-group.other input[type=checkbox]:first');
// savePreferences();
ok(!exists('.preferences-nav .nav-apps a'), "apps tab isn't there when you have no authorized apps");
});
test("username", () => {