Fix bug where pressing 'a' when logged out would show backdrop

Change-Id: I7976ffcd1ffb14e0833018e99a6661a91967364d
This commit is contained in:
Andrew Bonventre
2016-03-11 13:02:16 -05:00
parent 34c7f8660f
commit ebf0cbcbfc
2 changed files with 7 additions and 0 deletions

View File

@@ -306,6 +306,8 @@
switch (e.keyCode) {
case 65: // 'a'
if (!this._loggedIn) { return; }
e.preventDefault();
this.$.replyOverlay.open();
break;

View File

@@ -67,8 +67,13 @@ limitations under the License.
'Should navigate to /');
showStub.restore();
MockInteractions.pressAndReleaseKeyOn(element, 65); // 'a'
var overlayEl = element.$.replyOverlay;
assert.isFalse(overlayEl.opened);
element._loggedIn = true;
MockInteractions.pressAndReleaseKeyOn(element, 65); // 'a'
assert.isTrue(overlayEl.opened);
overlayEl.close();
assert.isFalse(overlayEl.opened);