Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core/event-list): add focus-visible outline #1467

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
46 changes: 33 additions & 13 deletions packages/core/src/tests/event-list/event-list.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,68 @@
* LICENSE file in the root directory of this source tree.
*/

import { expect } from '@playwright/test';
import { expect, Page } from '@playwright/test';
import { regressionTest } from '@utils/test';

const basicUrl = 'event-list/basic';
const compactUrl = 'event-list/compact';
const chevronUrl = 'event-list/chevron';
const customHeightUrl = 'event-list/custom-height';

async function pressTab(page: Page, count: number) {
for (let i = 0; i < count; i++) {
await page.keyboard.press('Tab');
}
}

regressionTest.describe('event-list', () => {
regressionTest('basic', async ({ page }) => {
await page.goto('event-list/basic');
await page.goto(basicUrl);
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});

regressionTest('compact', async ({ page }) => {
await page.goto('event-list/compact');
await page.goto(compactUrl);
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});

regressionTest('chevron', async ({ page }) => {
await page.goto('event-list/chevron');
await page.goto(chevronUrl);
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});

regressionTest('custom-height', async ({ page }) => {
await page.goto('event-list/custom-height');
await page.goto(customHeightUrl);
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});

regressionTest('hover', async ({ page }) => {
await page.goto('event-list/basic');
await page.goto(basicUrl);
await (await page.waitForSelector('text="Text 3"')).hover();
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});

regressionTest('outline', async ({ page }) => {
await page.goto('event-list/basic');
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await page.goto(basicUrl);
await pressTab(page, 2);
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});

regressionTest('outline selected', async ({ page }) => {
await page.goto('event-list/basic');
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await page.goto(basicUrl);
await pressTab(page, 3);
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});

regressionTest('outline compact', async ({ page }) => {
await page.goto(compactUrl);
await pressTab(page, 3);
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});

regressionTest('outline compact selected', async ({ page }) => {
await page.goto(compactUrl);
await pressTab(page, 3);
danielleroux marked this conversation as resolved.
Show resolved Hide resolved
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading