-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: toggle avt test * fix: test arial abelledby * fix: test arialabelledby - test * fix: test arialabelledby * feat: fix tests * fix: updating tests * fix: update tests * Update e2e/components/Toggle/Toggle-test.avt.e2e.js Co-authored-by: Guilherme Datilio Ribeiro <guilhermedatilio@gmail.com> * feat: added skeleton test * fix: tests * fix: tests aria * chore: update snapshots * feat: toggle avt test * fix: test arial abelledby * fix: test arialabelledby - test * fix: test arialabelledby * feat: fix tests * fix: updating tests * fix: update tests * Update e2e/components/Toggle/Toggle-test.avt.e2e.js Co-authored-by: Guilherme Datilio Ribeiro <guilhermedatilio@gmail.com> * feat: added skeleton test * fix: tests * fix: tests aria * chore: update snapshots * chore(snapshot): update snapshots * fix: snapshots --------- Co-authored-by: Guilherme Datilio Ribeiro <guilhermedatilio@gmail.com> Co-authored-by: Alison Joseph <alison.joseph@us.ibm.com> Co-authored-by: TJ Egan <tw15egan@gmail.com>
- Loading branch information
1 parent
41aa481
commit d4a0d04
Showing
8 changed files
with
83 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/** | ||
* Copyright IBM Corp. 2016, 2023 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const { expect, test } = require('@playwright/test'); | ||
const { visitStory } = require('../../test-utils/storybook'); | ||
|
||
test.describe('Toggle @avt', () => { | ||
test('accessibility-checker', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'Toggle', | ||
id: 'components-toggle--default', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
await expect(page).toHaveNoACViolations('Toggle'); | ||
}); | ||
|
||
test('accessibility-checker skeleton', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'Tabs', | ||
id: 'components-toggle--skeleton', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
await expect(page).toHaveNoACViolations('Toggle-skeleton'); | ||
}); | ||
|
||
test('accessibility-checker small toggle', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'Tabs', | ||
id: 'components-toggle--small-toggle', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
await expect(page).toHaveNoACViolations('Toggle-small'); | ||
}); | ||
|
||
test('accessibility-checker with accessible labels', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'Tabs', | ||
id: 'components-toggle--with-accessible-labels', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
await expect(page).toHaveNoACViolations('Toggle-accessible-labels'); | ||
}); | ||
|
||
test('default Toggle state - keyboard nav', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'Tabs', | ||
id: 'components-toggle--default', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
await page.keyboard.press('Tab'); | ||
await expect(page.getByRole('switch')).toBeVisible(); | ||
await page.keyboard.press('Space'); | ||
await page.getByText('Off'); | ||
await page.keyboard.press('Space'); | ||
await page.getByText('On'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters