Skip to content

Commit

Permalink
test: rendering test for keyboard nav in grid mode with all arrow keys (
Browse files Browse the repository at this point in the history
#1240)

* refactor: compensate for checkboxes in item width

* test: keyboard nav in grid mode rendering test

* test: upload snapshot

* test: rename with appending linux

* test: confirm selections to rm selections toolbar

* test: replace snapshot
  • Loading branch information
johanlahti committed Apr 25, 2023
1 parent d3d23ca commit bde7d11
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/rendering/listbox/listbox-keyboard-nav.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,26 @@ test.describe('keyboard navigation', () => {
const stillFocusingRow = await selector.screenshot({ caret: 'hide' });
expect(stillFocusingRow).toMatchSnapshot(`${filePrefix}-row-after-confirm.png`);
});

test('grid mode with column view and navigating in all directions with arrow keys and select "Baked goods".', async () => {
await page.goto(`${url}/listbox/listbox.html?fixture=./__fixtures__/multi_scenario_grid_column_7.js`, {
waitUntil: 'networkidle',
});
const selector = await page.waitForSelector(listboxSelector, { visible: true });

// Tab into search field.
await page.keyboard.press('Tab');

// Tab into first cell.
await page.keyboard.press('Tab');
await page.keyboard.press('ArrowDown');
await page.keyboard.press('ArrowRight');
await page.keyboard.press('ArrowRight');
await page.keyboard.press('ArrowUp');
await page.keyboard.press('ArrowLeft');
await page.keyboard.press('Space');
await page.keyboard.press('Enter');
const listbox = await selector.screenshot({ caret: 'hide' });
expect(listbox).toMatchSnapshot(`${filePrefix}-grid-row-select-baked-goods.png`);
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bde7d11

Please sign in to comment.