FIX: set overridden param for customize site text query only when checkbox value changes

This commit is contained in:
Maja Komel 2018-11-26 18:47:11 +01:00
parent a0fca2b6ed
commit a2bff038e8
2 changed files with 6 additions and 2 deletions

View File

@ -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);

View File

@ -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"));