-
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.
Browse files
Browse the repository at this point in the history
* test(Select): add @AVT tests * fix(Select): update avt tests
- Loading branch information
Showing
2 changed files
with
67 additions
and
10 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,66 @@ | ||
/** | ||
* 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('Select @avt', () => { | ||
test('accessibility-checker default', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'Select', | ||
id: 'components-select--default', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
await expect(page).toHaveNoACViolations('components-select--default'); | ||
}); | ||
|
||
test('accessibility-checker inline', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'Select', | ||
id: 'components-select--inline', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
await expect(page).toHaveNoACViolations('components-select--inline'); | ||
}); | ||
|
||
test('accessibility-checker skeleton', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'Select', | ||
id: 'components-select--skeleton', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
await expect(page).toHaveNoACViolations('components-select--skeleton'); | ||
}); | ||
|
||
test('select - keyboard nav', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'Select', | ||
id: 'components-select--default', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
|
||
const select = page.getByRole('combobox'); | ||
await expect(select).toBeVisible(); | ||
// Tab to Select | ||
await page.keyboard.press('Tab'); | ||
await expect(select).toBeFocused(); | ||
await expect(select).toHaveValue(''); | ||
// Select Option 4 | ||
await select.selectOption('Option 4'); | ||
await expect(select).toHaveValue('Option 4'); | ||
}); | ||
}); |
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