mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 10:55:54 +08:00
FIX: NavItem and Composer prop overriding was broken (#17092)
This commit is contained in:
parent
e0364cf228
commit
348b6e848f
|
@ -136,7 +136,7 @@ export default Controller.extend({
|
|||
},
|
||||
|
||||
set disableSubmit(value) {
|
||||
this.set("_disableSubmit", value);
|
||||
return this.set("_disableSubmit", value);
|
||||
},
|
||||
|
||||
@discourseComputed("showPreview")
|
||||
|
|
|
@ -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);
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
@ -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");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user