fix(menu): properly handle spacebar events (#1533)

Closes #1175
This commit is contained in:
Kara
2016-10-19 15:36:54 -07:00
committed by Jeremy Elbourn
parent 0b54668b4d
commit cfe3e981bd
3 changed files with 9 additions and 2 deletions
+6 -1
View File
@@ -73,11 +73,16 @@ describe('menu', () => {
page.pressKey(protractor.Key.TAB);
});
it('should auto-focus the first item when opened with keyboard', () => {
it('should auto-focus the first item when opened with ENTER', () => {
page.pressKey(protractor.Key.ENTER);
page.expectFocusOn(page.items(0));
});
it('should auto-focus the first item when opened with SPACE', () => {
page.pressKey(protractor.Key.SPACE);
page.expectFocusOn(page.items(0));
});
it('should not focus the first item when opened with mouse', () => {
page.trigger().click();
page.expectFocusOn(page.trigger());