Skip to content

Commit

Permalink
chore: pageheader refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
devadula-nandan committed Dec 11, 2024
1 parent 3d38fe6 commit 6d97a12
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions e2e/components/PageHeader/PageHeader-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,26 +191,17 @@ test.describe('PageHeader @avt', () => {
// focus on first focusable element
await page.getByRole('link', { name: 'Home page' }).focus();
await pressTabKey(page, 4);
console.log(await page.locator('*:focus').textContent());
(await page.locator('*:focus').textContent()) === 'Page actions...';
await page.keyboard.press('Enter');

// Ensure all buttons are rendered
await expect(
page.getByRole('menuitem', { name: /Primary button$/ })
).toBeFocused();
(await page.locator('*:focus').textContent()) === 'Primary button';
await page.keyboard.press('ArrowDown');
await expect(
page.getByRole('menuitem', { name: /Secondary button$/ })
).toBeFocused();
(await page.locator('*:focus').textContent()) === 'Secondary button';
await page.keyboard.press('ArrowDown');
await expect(
page.getByRole('menuitem', { name: /Danger button$/ })
).toBeFocused();
(await page.locator('*:focus').textContent()) === 'Danger button';
await page.keyboard.press('Escape');
await expect(
page.getByRole('button', { name: 'Page actions...' })
).toBeFocused();
(await page.locator('*:focus').textContent()) === 'Page actions...';
});

// action bar buttons move into MenuButton on small screens
Expand Down

0 comments on commit 6d97a12

Please sign in to comment.