-
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
Co-authored-by: Guilherme Datilio Ribeiro <[email protected]>
- Loading branch information
1 parent
ffc9ab1
commit 2b8b66c
Showing
2 changed files
with
80 additions
and
13 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,78 @@ | ||
/** | ||
* 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('TextArea @avt', () => { | ||
test('accessibility-checker TextArea', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'TextArea', | ||
id: 'components-textarea--default', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
await expect(page).toHaveNoACViolations('TextArea'); | ||
}); | ||
|
||
test('accessibility-checker TextArea invalid', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'TextArea', | ||
id: 'components-textarea--playground', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
args: { | ||
invalid: 'true', | ||
}, | ||
}); | ||
await expect(page).toHaveNoACViolations('TextArea invalid'); | ||
}); | ||
|
||
test('accessibility-checker TextArea warn', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'TextArea', | ||
id: 'components-textarea--playground', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
args: { | ||
warn: 'true', | ||
}, | ||
}); | ||
await expect(page).toHaveNoACViolations('TextArea warn'); | ||
}); | ||
|
||
test('accessibility-checker TextArea skeleton', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'TextArea', | ||
id: 'components-textarea--skeleton', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
await expect(page).toHaveNoACViolations('TextArea skeleton'); | ||
}); | ||
|
||
test('accessibility-checker TextArea keyboard counter', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'TextArea', | ||
id: 'components-textarea--playground', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
|
||
await expect(page.getByText('0/500')).toBeVisible(); | ||
await page.getByRole('textbox').fill('test'); | ||
await expect(page.getByText('4/500')).toBeVisible(); | ||
await expect(page).toHaveNoACViolations('TextArea keyboard counter'); | ||
}); | ||
}); |
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