Skip to content

Commit 5c89567

Browse files
committed
Add test for rerouting enters to clicks
1 parent 2474e32 commit 5c89567

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/puppeteer/demo.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,20 @@ it('leaves the menu open if you click inside of it', async () => {
8383

8484
expect(true).toBe(true);
8585
});
86+
87+
it('reroutes enter presses on menu items as clicks', async () => {
88+
let alertAppeared = false;
89+
90+
await page.click('#menu-button');
91+
await menuOpen();
92+
93+
page.on('dialog', async dialog => {
94+
alertAppeared = true;
95+
await dialog.dismiss();
96+
});
97+
98+
await page.focus('#menu-item-3');
99+
await keyboard.down('Enter');
100+
101+
expect(alertAppeared).toBe(true);
102+
});

0 commit comments

Comments
 (0)