Skip to content
Extraits de code Groupes Projets
Valider f1e296cc rédigé par Dennis Schubert's avatar Dennis Schubert Validation de GitHub
Parcourir les fichiers

Merge pull request #6870 from svbergerem/update-status-message-text-prefill-mention

Update status message text after prefilling mentions
parents 2e267112 657eec29
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -135,6 +135,10 @@ app.views.Publisher = Backbone.View.extend({ ...@@ -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() { ...@@ -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");
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter