Update status message text after prefilling mentions
This commit is contained in:
parent
c357d229ed
commit
657eec29f0
2 changed files with 19 additions and 0 deletions
|
|
@ -135,6 +135,10 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
});
|
});
|
||||||
this.viewPollCreator.on("change", this.checkSubmitAvailability, this);
|
this.viewPollCreator.on("change", this.checkSubmitAvailability, this);
|
||||||
this.viewPollCreator.render();
|
this.viewPollCreator.render();
|
||||||
|
|
||||||
|
if (this.prefillMention) {
|
||||||
|
this.handleTextchange();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// set the selected aspects in the dropdown by their ids
|
// set the selected aspects in the dropdown by their ids
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,21 @@ describe("app.views.Publisher", function() {
|
||||||
this.view = new app.views.Publisher();
|
this.view = new app.views.Publisher();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("#initSubviews", function() {
|
||||||
|
it("calls handleTextchange if the publisher is prefilled with mentions", function() {
|
||||||
|
spyOn(this.view, "handleTextchange");
|
||||||
|
this.view.prefillMention = "user@example.org";
|
||||||
|
this.view.initSubviews();
|
||||||
|
expect(this.view.handleTextchange).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("doesn't call handleTextchange if there are no prefilled mentions", function() {
|
||||||
|
spyOn(this.view, "handleTextchange");
|
||||||
|
this.view.initSubviews();
|
||||||
|
expect(this.view.handleTextchange).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("#open", function() {
|
describe("#open", function() {
|
||||||
it("removes the 'closed' class from the publisher element", function() {
|
it("removes the 'closed' class from the publisher element", function() {
|
||||||
expect($(this.view.el)).toHaveClass("closed");
|
expect($(this.view.el)).toHaveClass("closed");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue