Add setIcon function to gr-change-actions-js-api
Change-Id: I937009516b1a962bab58ef3f8feecacd24643abd
This commit is contained in:
@@ -119,6 +119,11 @@
|
||||
this._el.setActionButtonProp(key, 'enabled', enabled);
|
||||
};
|
||||
|
||||
GrChangeActionsInterface.prototype.setIcon = function(key, icon) {
|
||||
ensureEl(this);
|
||||
this._el.setActionButtonProp(key, 'icon', icon);
|
||||
};
|
||||
|
||||
GrChangeActionsInterface.prototype.getActionDetails = function(action) {
|
||||
ensureEl(this);
|
||||
return this._el.getActionDetails(action) ||
|
||||
|
||||
@@ -144,9 +144,12 @@ breaking changes to gr-change-actions won’t be noticed.
|
||||
assert.isNotOk(button.disabled);
|
||||
changeActions.setLabel(key, 'Yo');
|
||||
changeActions.setEnabled(key, false);
|
||||
changeActions.setIcon(key, 'pupper');
|
||||
flush(() => {
|
||||
assert.equal(button.getAttribute('data-label'), 'Yo');
|
||||
assert.isTrue(button.disabled);
|
||||
assert.equal(Polymer.dom(button).querySelector('iron-icon').icon,
|
||||
'gr-icons:pupper');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user