diff --git a/app/assets/javascripts/discourse/app/controllers/composer.js b/app/assets/javascripts/discourse/app/controllers/composer.js index 37706589b9d..04f4fcf47bd 100644 --- a/app/assets/javascripts/discourse/app/controllers/composer.js +++ b/app/assets/javascripts/discourse/app/controllers/composer.js @@ -136,7 +136,7 @@ export default Controller.extend({ }, set disableSubmit(value) { - this.set("_disableSubmit", value); + return this.set("_disableSubmit", value); }, @discourseComputed("showPreview") diff --git a/app/assets/javascripts/discourse/app/models/nav-item.js b/app/assets/javascripts/discourse/app/models/nav-item.js index 9b4cec0f764..56d1f9566c1 100644 --- a/app/assets/javascripts/discourse/app/models/nav-item.js +++ b/app/assets/javascripts/discourse/app/models/nav-item.js @@ -27,7 +27,7 @@ const NavItem = EmberObject.extend({ }, set(value) { - this.set("_title", value); + return this.set("_title", value); }, }, @@ -56,7 +56,7 @@ const NavItem = EmberObject.extend({ }, set(value) { - this.set("_displayName", value); + return this.set("_displayName", value); }, }, diff --git a/app/assets/javascripts/discourse/tests/unit/models/nav-item-test.js b/app/assets/javascripts/discourse/tests/unit/models/nav-item-test.js index d1b5bab44e8..a7a1386fc7c 100644 --- a/app/assets/javascripts/discourse/tests/unit/models/nav-item-test.js +++ b/app/assets/javascripts/discourse/tests/unit/models/nav-item-test.js @@ -57,4 +57,29 @@ module("Unit | Model | nav-item", function (hooks) { "it updates when a new message arrives" ); }); + + test("displayName", function (assert) { + const navItem = createStore().createRecord("nav-item", { + name: "something", + }); + + assert.strictEqual( + navItem.displayName, + "[en.filters.something.title count=0]" + ); + + navItem.set("displayName", "Extra Item"); + assert.strictEqual(navItem.displayName, "Extra Item"); + }); + + test("title", function (assert) { + const navItem = createStore().createRecord("nav-item", { + name: "something", + }); + + assert.strictEqual(navItem.title, "[en.filters.something.help]"); + + navItem.set("title", "Extra Item"); + assert.strictEqual(navItem.title, "Extra Item"); + }); });