diff --git a/frontend/app/components/wp-activity/user/user-activity-directive.ts b/frontend/app/components/wp-activity/user/user-activity-directive.ts index 7a4d0dab80..b5205fa7a7 100644 --- a/frontend/app/components/wp-activity/user/user-activity-directive.ts +++ b/frontend/app/components/wp-activity/user/user-activity-directive.ts @@ -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; }); diff --git a/spec/features/work_packages/details/activity_comments_spec.rb b/spec/features/work_packages/details/activity_comments_spec.rb index 91a825eaed..c240f5d839 100644 --- a/spec/features/work_packages/details/activity_comments_spec.rb +++ b/spec/features/work_packages/details/activity_comments_spec.rb @@ -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