diff --git a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.html b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.html index afd0e594b4..54cd529ce7 100644 --- a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.html +++ b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.html @@ -264,6 +264,7 @@ limitations under the License. id="deleteBtn" link class$="action delete [[_computeDeleteButtonClass(_isAdmin, draft)]]" + hidden$="[[isRobotComment]]" on-click="_handleCommentDelete"> diff --git a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_test.html b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_test.html index 065801b318..e3391a0a19 100644 --- a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_test.html +++ b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_test.html @@ -440,6 +440,9 @@ limitations under the License. assert.isFalse(element.$$('.humanActions').hasAttribute('hidden')); assert.isTrue(element.$$('.robotActions').hasAttribute('hidden')); + // Delete button is not hidden by default + assert.isFalse(element.shadowRoot.querySelector('#deleteBtn').hidden); + element.isRobotComment = true; element.draft = true; assert.isTrue(element.$$('.humanActions').hasAttribute('hidden')); @@ -463,6 +466,9 @@ limitations under the License. flushAsynchronousOperations(); assert.notEqual(getComputedStyle(element.$$('.robotRun.link')).display, 'none'); + + // Delete button is hidden for robot comments + assert.isTrue(element.shadowRoot.querySelector('#deleteBtn').hidden); }); test('collapsible drafts', () => {