Merge "Revert "Preserve fix suggestion when editing draft comment""
diff --git a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts
index c2768ba..2881ac5 100644
--- a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts
+++ b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts
@@ -1476,11 +1476,6 @@
this.originalMessage = this.messageText;
this.originalUnresolved = this.unresolved;
}
- if (this.comment?.fix_suggestions?.[0]) {
- this.generatedFixSuggestion = this.comment.fix_suggestions[0];
- this.previewedGeneratedFixSuggestion = this.comment.fix_suggestions[0];
- this.generateSuggestion = true;
- }
}
// Parent components such as the reply dialog might be interested in whether
diff --git a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_test.ts b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_test.ts
index 41429b1..bf3a54d 100644
--- a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_test.ts
+++ b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_test.ts
@@ -1087,41 +1087,6 @@
);
});
- test('editing draft comment preserves fix suggestion', async () => {
- const comment: DraftInfo = {
- ...createDraft(),
- author: {
- name: 'Mr. Peanutbutter',
- email: 'tenn1sballchaser@aol.com' as EmailAddress,
- },
- line: 5,
- path: 'test',
- savingState: SavingState.OK,
- message: 'hello world',
- fix_suggestions: [generatedFixSuggestion],
- };
- element = await fixture(
- html`<gr-comment
- .account=${account}
- .showPatchset=${true}
- .comment=${comment}
- .initiallyCollapsed=${false}
- ></gr-comment>`
- );
- assert.isFalse(element.editing);
-
- element.edit();
- await element.updateComplete;
-
- assert.isTrue(element.editing);
- assert.deepEqual(element.generatedFixSuggestion, generatedFixSuggestion);
- assert.deepEqual(
- element.previewedGeneratedFixSuggestion,
- generatedFixSuggestion
- );
- assert.isTrue(element.generateSuggestion);
- });
-
suite('save', () => {
const savePromise = mockPromise<DraftInfo>();
let saveDraftStub: SinonStub;