Suggest label score plugin sample
Change-Id: I746ebd99c97d10e921b196ba8d219e50a4f84a2d
This commit is contained in:
@@ -73,5 +73,20 @@
|
||||
});
|
||||
};
|
||||
|
||||
GrChangeReplyInterface.prototype.addLabelValuesChangedCallback =
|
||||
function(handler) {
|
||||
this.plugin.hook('reply-label-scores').onAttached(el => {
|
||||
if (!el.content) { return; }
|
||||
|
||||
el.content.addEventListener('labels-changed', e => {
|
||||
handler(e.detail);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
GrChangeReplyInterface.prototype.showMessage = function(message) {
|
||||
return this._el.setPluginMessage(message);
|
||||
};
|
||||
|
||||
window.GrChangeReplyInterface = GrChangeReplyInterface;
|
||||
})(window);
|
||||
|
||||
@@ -78,6 +78,10 @@ breaking changes to gr-reply-dialog won’t be noticed.
|
||||
sandbox.stub(element, 'send');
|
||||
changeReply.send(false);
|
||||
assert.isTrue(element.send.calledWithExactly(false));
|
||||
|
||||
sandbox.stub(element, 'setPluginMessage');
|
||||
changeReply.showMessage('foobar');
|
||||
assert.isTrue(element.setPluginMessage.calledWithExactly('foobar'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -105,6 +109,10 @@ breaking changes to gr-reply-dialog won’t be noticed.
|
||||
sandbox.stub(element, 'send');
|
||||
changeReply.send(false);
|
||||
assert.isTrue(element.send.calledWithExactly(false));
|
||||
|
||||
sandbox.stub(element, 'setPluginMessage');
|
||||
changeReply.showMessage('foobar');
|
||||
assert.isTrue(element.setPluginMessage.calledWithExactly('foobar'));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user