From 96aee443fa85eb73b489772698832fe1c4dd0f68 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Wed, 3 May 2017 13:49:16 -0400 Subject: [PATCH] wip js test --- .../acceptance/preferences-test.js.es6 | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/test/javascripts/acceptance/preferences-test.js.es6 b/test/javascripts/acceptance/preferences-test.js.es6 index ec5745ca242..cd652bbbdec 100644 --- a/test/javascripts/acceptance/preferences-test.js.es6 +++ b/test/javascripts/acceptance/preferences-test.js.es6 @@ -10,15 +10,37 @@ test("update some fields", () => { ok(exists('.user-preferences'), 'it shows the preferences'); }); + 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(".preferences-nav .nav-profile a"); - fillIn("#edit-location", "Westeros"); + 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(".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"); + + 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", () => {