-
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.
test(Slug): add VRT, AVT tests (#15238)
* test(Slug): add VRT, AVT tests * test(Slug): test form story --------- Co-authored-by: Andrea N. Cardona <cardona.n.andrea@gmail.com>
- Loading branch information
1 parent
41c1f75
commit 17288ff
Showing
3 changed files
with
87 additions
and
1 deletion.
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,50 @@ | ||
/** | ||
* 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('Slug @avt', () => { | ||
test('@avt-default-state', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'Slug', | ||
id: 'experimental-unstable-slug--default', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
await expect(page).toHaveNoACViolations('Slug'); | ||
}); | ||
|
||
test('@avt-advanced-states open state', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'Slug', | ||
id: 'experimental-unstable-slug--default', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
await page.keyboard.press('Tab'); | ||
await page.keyboard.press('Tab'); | ||
await page.keyboard.press('Tab'); | ||
await page.keyboard.press('Enter'); | ||
await expect(page).toHaveNoACViolations('Slug-open'); | ||
}); | ||
|
||
test('@avt-advanced-states ai form', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'Slug', | ||
id: 'components-form--ai-form', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
await expect(page).toHaveNoACViolations('Slug-form'); | ||
}); | ||
}); |
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,34 @@ | ||
/** | ||
* 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 { test } = require('@playwright/test'); // eslint-disable-line | ||
const { themes } = require('../../test-utils/env'); | ||
const { snapshotStory } = require('../../test-utils/storybook'); // eslint-disable-line | ||
|
||
test.describe('Slug', () => { | ||
themes.forEach((theme) => { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({ page }) => { | ||
await snapshotStory(page, { | ||
component: 'Slug', | ||
id: 'experimental-unstable-slug--default', | ||
theme, | ||
}); | ||
}); | ||
|
||
test('slug inside form @vrt', async ({ page }) => { | ||
await snapshotStory(page, { | ||
component: 'Slug', | ||
id: 'components-form--ai-form', | ||
theme, | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
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