save comment when another attribe change
parent
d264c2db2d
commit
190d0287d1
|
@ -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
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue