diff --git a/app/coffee/modules/common.coffee b/app/coffee/modules/common.coffee index e6b47dbe..0113b34d 100644 --- a/app/coffee/modules/common.coffee +++ b/app/coffee/modules/common.coffee @@ -293,10 +293,18 @@ class QueueModelTransformation extends taiga.Service defered = @q.defer() @qqueue.add () => + obj = @.getObj() + comment = obj.comment + + obj.comment = '' + clone = @.clone() transformation(clone) + if comment.length + clone.comment = comment + success = () => @.scope[@.prop] = clone diff --git a/e2e/helpers/detail-helper.js b/e2e/helpers/detail-helper.js index 280a141d..bad59b39 100644 --- a/e2e/helpers/detail-helper.js +++ b/e2e/helpers/detail-helper.js @@ -158,11 +158,15 @@ helper.history = function() { }, addComment: async function(comment) { - el.$('textarea[tg-markitup]').sendKeys(comment); + obj.writeComment(comment); el.$('.save-comment').click(); await browser.waitForAngular(); }, + writeComment: function(comment) { + el.$('textarea[tg-markitup]').sendKeys(comment); + }, + countComments: async function() { let moreComments = el.$('.comments-list .show-more-comments'); let moreCommentsIsPresent = await moreComments.isPresent(); diff --git a/e2e/shared/detail.js b/e2e/shared/detail.js index fc59b856..ca61a479 100644 --- a/e2e/shared/detail.js +++ b/e2e/shared/detail.js @@ -209,14 +209,26 @@ shared.historyTesting = async function() { let newDeletedCommentsCounter = await historyHelper.countDeletedComments(); expect(newDeletedCommentsCounter).to.be.equal(deletedCommentsCounter+1); - //Restore last coment + //Restore last comment deletedCommentsCounter = await historyHelper.countDeletedComments(); await historyHelper.restoreLastComment(); newDeletedCommentsCounter = await historyHelper.countDeletedComments(); expect(newDeletedCommentsCounter).to.be.equal(deletedCommentsCounter-1); + //Store comment with a modification + commentsCounter = await historyHelper.countComments(); + + historyHelper.writeComment("New comment " + date); + let title = detailHelper.title(); + title.setTitle('changed'); + title.save(); + + newCommentsCounter = await historyHelper.countComments(); + + expect(newCommentsCounter).to.be.equal(commentsCounter+1); + //Check activity - historyHelper.selectActivityTab(); + await historyHelper.selectActivityTab(); let activitiesCounter = await historyHelper.countActivities();