Merge branch 'release/0.7.0.0' into next-minor

This commit is contained in:
Benjamin Neff 2017-08-17 11:42:11 +02:00
commit a01cc4dfcb
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
4 changed files with 13 additions and 1 deletions

View file

@ -118,7 +118,8 @@ app.views.CommentStream = app.views.Base.extend({
// on post ownership in the Comment view. // on post ownership in the Comment view.
comment.set({parent : this.model.toJSON()}); comment.set({parent : this.model.toJSON()});
var commentHtml = new this.CommentView({model: comment}).render().el; var commentView = new this.CommentView({model: comment});
var commentHtml = commentView.render().el;
var commentBlocks = this.$(".comments div.comment.media"); var commentBlocks = this.$(".comments div.comment.media");
this._moveInsertPoint(comment.get("created_at"), commentBlocks); this._moveInsertPoint(comment.get("created_at"), commentBlocks);
if (this._insertPoint >= commentBlocks.length) { if (this._insertPoint >= commentBlocks.length) {
@ -128,6 +129,7 @@ app.views.CommentStream = app.views.Base.extend({
} else { } else {
commentBlocks.eq(this._insertPoint).before(commentHtml); commentBlocks.eq(this._insertPoint).before(commentHtml);
} }
commentView.renderPluginWidgets();
}, },
removeComment: function(comment) { removeComment: function(comment) {

View file

@ -4,6 +4,7 @@
app.views.Comment = app.views.Content.extend({ app.views.Comment = app.views.Content.extend({
templateName: "comment", templateName: "comment",
className : "comment media", className : "comment media",
tooltipSelector: "time",
events : function() { events : function() {
return _.extend({}, app.views.Content.prototype.events, { return _.extend({}, app.views.Content.prototype.events, {

View file

@ -109,6 +109,7 @@ When /^I click to delete the first post$/ do
accept_alert do accept_alert do
step "I prepare the deletion of the first post" step "I prepare the deletion of the first post"
end end
expect(find(".stream")).to have_no_css(".stream-element.loaded.deleting")
end end
When /^I click to hide the first post$/ do When /^I click to hide the first post$/ do

View file

@ -267,6 +267,14 @@ describe("app.views.CommentStream", function(){
expect(this.view.$(".comments div.comment.media").length).toEqual(6); expect(this.view.$(".comments div.comment.media").length).toEqual(6);
expect(this.view.$(".comments div.comment.media div.comment-content p").text()).toEqual("123456"); expect(this.view.$(".comments div.comment.media div.comment-content p").text()).toEqual("123456");
}); });
it("calls renderPluginWidgets", function() {
var comment = factory.comment();
this.view.CommentView = app.views.Comment;
spyOn(app.views.Comment.prototype, "renderPluginWidgets");
this.view.appendComment(comment);
expect(app.views.Comment.prototype.renderPluginWidgets).toHaveBeenCalled();
});
}); });
describe("removeComment", function() { describe("removeComment", function() {