Re-add _handleFix to diff comment

Bug: Issue 9492
Change-Id: I58c8dc4e4adb1face8dd32598836395e60f6ecc7
This commit is contained in:
Kasper Nilsson
2018-08-06 10:36:42 -07:00
parent 55a9a94941
commit e65d6231e7
2 changed files with 18 additions and 0 deletions

View File

@@ -449,6 +449,13 @@
this.fire('comment-discard', this._getEventPayload());
},
_handleFix() {
this.dispatchEvent(new CustomEvent('create-fix-comment', {
bubbles: true,
detail: this._getEventPayload(),
}));
},
_handleDiscard(e) {
e.preventDefault();
this.$.reporting.recordDraftInteraction();

View File

@@ -841,5 +841,16 @@ limitations under the License.
element.save();
assert.isTrue(discardStub.called);
});
test('_handleFix fires create-fix event', done => {
element.addEventListener('create-fix-comment', e => {
assert.deepEqual(e.detail, element._getEventPayload());
done();
});
element.isRobotComment = true;
flushAsynchronousOperations();
MockInteractions.tap(element.$$('.fix'));
});
});
</script>