Skip to content

Commit

Permalink
test: fix test for the onFocus
Browse files Browse the repository at this point in the history
  • Loading branch information
guidari committed Mar 5, 2024
1 parent 5187d84 commit 8ca4780
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
const { expect, test } = require('@playwright/test');
const { visitStory } = require('../../test-utils/storybook');

test.describe('DefinitionTooltip @avt', () => {
test.describe('@avt DefinitionTooltip', () => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'DefinitionTooltip',
Expand All @@ -24,7 +24,7 @@ test.describe('DefinitionTooltip @avt', () => {
);
});

test('@avt-keyboard-state default', async ({ page }) => {
test('@avt-keyboard-nav default', async ({ page }) => {
await visitStory(page, {
component: 'DefinitionTooltip',
id: 'components-definitiontooltip--default',
Expand All @@ -38,10 +38,10 @@ test.describe('DefinitionTooltip @avt', () => {
const primaryButton = page.getByRole('button', { name: 'URL' });

// Testing DefinitionTooltip
await page.keyboard.press('Tab');
await expect(primaryButton).toBeVisible();
await expect(primaryButton).toHaveAttribute('aria-expanded', 'false');
await primaryButton.click();
await page.keyboard.press('Tab');
await expect(primaryButton).toHaveAttribute('aria-expanded', 'true');
await primaryButton.click();
await expect(primaryButton).toHaveAttribute('aria-expanded', 'false');
});
});

0 comments on commit 8ca4780

Please sign in to comment.