Merge pull request #5209 from opf/fix/24681/edit-empty-comment

[24681] Allow users to remove comment by setting it to empty
pull/5210/head
Oliver Günther 8 years ago committed by GitHub
commit f19a224e1b
  1. 2
      frontend/app/components/wp-activity/user/user-activity-directive.ts
  2. 15
      spec/features/work_packages/details/activity_comments_spec.rb

@ -125,7 +125,7 @@ function userActivity($uiViewScroll:any,
};
scope.updateComment = function () {
ActivityService.updateComment(scope.activity, scope.activity.editedComment).then(function () {
ActivityService.updateComment(scope.activity, scope.activity.editedComment || '').then(function () {
scope.workPackage.updateActivities();
scope.inEdit = false;
});

@ -174,6 +174,21 @@ describe 'activity comments', js: true, selenium: true do
edit.submit_by_click
expect(page).to have_selector('.user-comment .message em', text: 'italic text')
expect(page).to have_selector('.user-comment .message', text: 'Comment with italic text')
# Clear the comment
activity = page.find('#activity-2')
page.driver.browser.action.move_to(activity.native).perform
# Check the edit textarea
activity.find('.icon-edit').click
edit = WorkPackageTextAreaField.new wp_page,
'comment',
selector: '.user-comment--form'
edit.set_value ''
edit.submit_by_click
expect(page).to have_no_selector('#activity-2 .user-comment .message em', text: 'italic text')
end
end
end

Loading…
Cancel
Save