Merge "Fix exception when deleting a change"
This commit is contained in:
commit
37fe386fdf
@ -562,6 +562,9 @@
|
||||
},
|
||||
|
||||
_setLoadingOnButtonWithKey: function(key) {
|
||||
// Return a NoOp for menu keys. @see Issue 5366
|
||||
if (MENU_ACTION_KEYS.indexOf(key) !== -1) { return function() {}; }
|
||||
|
||||
var buttonEl = this.$$('[data-action-key="' + key + '"]');
|
||||
buttonEl.setAttribute('loading', true);
|
||||
buttonEl.disabled = true;
|
||||
|
@ -382,6 +382,30 @@ limitations under the License.
|
||||
});
|
||||
});
|
||||
|
||||
test('_setLoadingOnButtonWithKey top-level', function() {
|
||||
var key = 'rebase';
|
||||
var cleanup = element._setLoadingOnButtonWithKey(key);
|
||||
|
||||
var button = element.$$('[data-action-key="' + key + '"]');
|
||||
assert.isTrue(button.hasAttribute('loading'));
|
||||
assert.isTrue(button.disabled);
|
||||
|
||||
assert.isOk(cleanup);
|
||||
assert.isFunction(cleanup);
|
||||
cleanup();
|
||||
|
||||
assert.isFalse(button.hasAttribute('loading'));
|
||||
assert.isFalse(button.disabled);
|
||||
});
|
||||
|
||||
test('_setLoadingOnButtonWithKey overflow menu', function() {
|
||||
// TODO(wyatta): Should not throw error when setting loading on an
|
||||
// overflow action. @see Issue 5366
|
||||
var key = 'cherrypick';
|
||||
var cleanup = element._setLoadingOnButtonWithKey(key);
|
||||
assert.isFunction(cleanup);
|
||||
});
|
||||
|
||||
suite('revert change', function() {
|
||||
var alertStub;
|
||||
var fireActionStub;
|
||||
|
Loading…
Reference in New Issue
Block a user