From a2bff038e8f3a9b17aa7f4df5bd3ee3b368128b2 Mon Sep 17 00:00:00 2001 From: Maja Komel Date: Mon, 26 Nov 2018 18:47:11 +0100 Subject: [PATCH] FIX: set overridden param for customize site text query only when checkbox value changes --- .../admin/controllers/admin-site-text-index.js.es6 | 3 +-- test/javascripts/acceptance/admin-site-text-test.js.es6 | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/admin/controllers/admin-site-text-index.js.es6 b/app/assets/javascripts/admin/controllers/admin-site-text-index.js.es6 index 6aad6a961e7..a62c74001ac 100644 --- a/app/assets/javascripts/admin/controllers/admin-site-text-index.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-site-text-index.js.es6 @@ -25,8 +25,7 @@ export default Ember.Controller.extend({ }, search(overridden) { - this.set("overridden", overridden); - + if (typeof overridden === "boolean") this.set("overridden", overridden); const q = this.get("q"); if (q !== lastSearch || overridden !== lastOverridden) { this.set("searching", true); diff --git a/test/javascripts/acceptance/admin-site-text-test.js.es6 b/test/javascripts/acceptance/admin-site-text-test.js.es6 index 766dd1d745a..d37f486f1af 100644 --- a/test/javascripts/acceptance/admin-site-text-test.js.es6 +++ b/test/javascripts/acceptance/admin-site-text-test.js.es6 @@ -7,12 +7,17 @@ QUnit.test("search for a key", async assert => { await fillIn(".site-text-search", "Test"); + assert.equal(currentURL(), "/admin/customize/site_texts?q=Test"); assert.ok(exists(".site-text")); assert.ok(exists(".site-text:not(.overridden)")); assert.ok(exists(".site-text.overridden")); // Only show overridden await click(".extra-options input"); + assert.equal( + currentURL(), + "/admin/customize/site_texts?overridden=true&q=Test" + ); assert.ok(!exists(".site-text:not(.overridden)")); assert.ok(exists(".site-text.overridden"));