test: rendering test for keyboard nav in grid mode with all arrow keys (#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
This commit is contained in:
Johan Lahti
2023-04-25 08:39:53 +02:00
committed by GitHub
parent d3d23caceb
commit bde7d118d1
2 changed files with 22 additions and 0 deletions

View File

@@ -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`);
});
});