-
Notifications
You must be signed in to change notification settings - Fork 548
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(AutoComplete): add e2e tests (#5417)
* test(AutoComplete): add e2e tests * test(vrt): update snapshots * fix(Autocomplete): wait for full render before e2e testing * test(vrt): update snapshots * fix dev storybook accessibility * fix lint * fix theme related a11y errors * test(vrt): update snapshots * ignore color-contrast rule * add aria-label to dialog * fix tests maybe? * remove playground snaps * test(vrt): update snapshots * retry mask * fix contrast failure * try to disable flaky test * test(vrt): update snapshots * remove rule * fix vrt test * format fix * update assertion * test(vrt): update snapshots * disable aria rule * add label --------- Co-authored-by: francinelucca <[email protected]> Co-authored-by: Randall Krauskopf <[email protected]> Co-authored-by: randall-krauskopf <[email protected]> Co-authored-by: Katie Langerman <[email protected]> Co-authored-by: langermank <[email protected]> Co-authored-by: Hussam Ghazzi <[email protected]> Co-authored-by: hussam-i-am <[email protected]>
- Loading branch information
1 parent
becad7d
commit bd568fd
Showing
113 changed files
with
276 additions
and
3 deletions.
There are no files selected for viewing
Binary file added
BIN
+13.3 KB
...ocomplete.test.ts-snapshots/Autocomplete-Add-New-Item-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.6 KB
.../Autocomplete.test.ts-snapshots/Autocomplete-Add-New-Item-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.7 KB
...mplete.test.ts-snapshots/Autocomplete-Add-New-Item-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.3 KB
...ponents/Autocomplete.test.ts-snapshots/Autocomplete-Add-New-Item-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.3 KB
...ocomplete.test.ts-snapshots/Autocomplete-Add-New-Item-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.4 KB
...complete.test.ts-snapshots/Autocomplete-Add-New-Item-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.5 KB
...plete.test.ts-snapshots/Autocomplete-Add-New-Item-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.4 KB
...onents/Autocomplete.test.ts-snapshots/Autocomplete-Add-New-Item-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.4 KB
...complete.test.ts-snapshots/Autocomplete-Add-New-Item-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.5 KB
...test.ts-snapshots/Autocomplete-Async-Loading-Of-Items-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.8 KB
...ete.test.ts-snapshots/Autocomplete-Async-Loading-Of-Items-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.8 KB
...t.ts-snapshots/Autocomplete-Async-Loading-Of-Items-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.5 KB
...tocomplete.test.ts-snapshots/Autocomplete-Async-Loading-Of-Items-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.5 KB
...test.ts-snapshots/Autocomplete-Async-Loading-Of-Items-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.6 KB
...est.ts-snapshots/Autocomplete-Async-Loading-Of-Items-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.6 KB
....ts-snapshots/Autocomplete-Async-Loading-Of-Items-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.6 KB
...ocomplete.test.ts-snapshots/Autocomplete-Async-Loading-Of-Items-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.6 KB
...est.ts-snapshots/Autocomplete-Async-Loading-Of-Items-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.6 KB
....ts-snapshots/Autocomplete-Custom-Overlay-Menu-Anchor-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+18.6 KB
...test.ts-snapshots/Autocomplete-Custom-Overlay-Menu-Anchor-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.1 KB
...-snapshots/Autocomplete-Custom-Overlay-Menu-Anchor-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.6 KB
...mplete.test.ts-snapshots/Autocomplete-Custom-Overlay-Menu-Anchor-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.6 KB
....ts-snapshots/Autocomplete-Custom-Overlay-Menu-Anchor-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.6 KB
...ts-snapshots/Autocomplete-Custom-Overlay-Menu-Anchor-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.7 KB
...snapshots/Autocomplete-Custom-Overlay-Menu-Anchor-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.6 KB
...plete.test.ts-snapshots/Autocomplete-Custom-Overlay-Menu-Anchor-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+17.6 KB
...ts-snapshots/Autocomplete-Custom-Overlay-Menu-Anchor-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+16.9 KB
...est.ts-snapshots/Autocomplete-Custom-Search-Filter-Fn-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+18 KB
...te.test.ts-snapshots/Autocomplete-Custom-Search-Filter-Fn-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+16.4 KB
....ts-snapshots/Autocomplete-Custom-Search-Filter-Fn-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+16.9 KB
...ocomplete.test.ts-snapshots/Autocomplete-Custom-Search-Filter-Fn-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+16.9 KB
...est.ts-snapshots/Autocomplete-Custom-Search-Filter-Fn-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+17.1 KB
...st.ts-snapshots/Autocomplete-Custom-Search-Filter-Fn-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+17.1 KB
...ts-snapshots/Autocomplete-Custom-Search-Filter-Fn-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+17.1 KB
...complete.test.ts-snapshots/Autocomplete-Custom-Search-Filter-Fn-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+17.1 KB
...st.ts-snapshots/Autocomplete-Custom-Search-Filter-Fn-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.8 KB
...s-snapshots/Autocomplete-Custom-Sort-After-Menu-Close-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+16.9 KB
...st.ts-snapshots/Autocomplete-Custom-Sort-After-Menu-Close-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.3 KB
...napshots/Autocomplete-Custom-Sort-After-Menu-Close-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.8 KB
...lete.test.ts-snapshots/Autocomplete-Custom-Sort-After-Menu-Close-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.8 KB
...s-snapshots/Autocomplete-Custom-Sort-After-Menu-Close-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.9 KB
...-snapshots/Autocomplete-Custom-Sort-After-Menu-Close-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+16 KB
...apshots/Autocomplete-Custom-Sort-After-Menu-Close-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.9 KB
...ete.test.ts-snapshots/Autocomplete-Custom-Sort-After-Menu-Close-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.9 KB
...-snapshots/Autocomplete-Custom-Sort-After-Menu-Close-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+12.9 KB
...s/Autocomplete.test.ts-snapshots/Autocomplete-Default-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.2 KB
...nents/Autocomplete.test.ts-snapshots/Autocomplete-Default-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+12.3 KB
...utocomplete.test.ts-snapshots/Autocomplete-Default-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+12.9 KB
...s/components/Autocomplete.test.ts-snapshots/Autocomplete-Default-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+12.9 KB
...s/Autocomplete.test.ts-snapshots/Autocomplete-Default-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+13 KB
.../Autocomplete.test.ts-snapshots/Autocomplete-Default-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+13.1 KB
...tocomplete.test.ts-snapshots/Autocomplete-Default-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+13 KB
.../components/Autocomplete.test.ts-snapshots/Autocomplete-Default-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+13 KB
.../Autocomplete.test.ts-snapshots/Autocomplete-Default-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+29.7 KB
...tocomplete.test.ts-snapshots/Autocomplete-In-A-Dialog-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+33.6 KB
...s/Autocomplete.test.ts-snapshots/Autocomplete-In-A-Dialog-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+34.8 KB
...omplete.test.ts-snapshots/Autocomplete-In-A-Dialog-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+29.7 KB
...mponents/Autocomplete.test.ts-snapshots/Autocomplete-In-A-Dialog-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+29.7 KB
...tocomplete.test.ts-snapshots/Autocomplete-In-A-Dialog-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+34.5 KB
...ocomplete.test.ts-snapshots/Autocomplete-In-A-Dialog-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+33 KB
...mplete.test.ts-snapshots/Autocomplete-In-A-Dialog-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+34.5 KB
...ponents/Autocomplete.test.ts-snapshots/Autocomplete-In-A-Dialog-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+34.5 KB
...ocomplete.test.ts-snapshots/Autocomplete-In-A-Dialog-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.7 KB
...ocomplete-In-Overlay-With-Custom-Scroll-Container-Ref-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.8 KB
.../Autocomplete-In-Overlay-With-Custom-Scroll-Container-Ref-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.2 KB
...mplete-In-Overlay-With-Custom-Scroll-Container-Ref-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.7 KB
...apshots/Autocomplete-In-Overlay-With-Custom-Scroll-Container-Ref-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.7 KB
...ocomplete-In-Overlay-With-Custom-Scroll-Container-Ref-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.7 KB
...complete-In-Overlay-With-Custom-Scroll-Container-Ref-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.7 KB
...plete-In-Overlay-With-Custom-Scroll-Container-Ref-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.7 KB
...pshots/Autocomplete-In-Overlay-With-Custom-Scroll-Container-Ref-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.7 KB
...complete-In-Overlay-With-Custom-Scroll-Container-Ref-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+11.6 KB
...ts/Autocomplete-Rendering-The-Menu-Outside-An-Overlay-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+11.7 KB
...pshots/Autocomplete-Rendering-The-Menu-Outside-An-Overlay-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+11.6 KB
...Autocomplete-Rendering-The-Menu-Outside-An-Overlay-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+11.6 KB
....ts-snapshots/Autocomplete-Rendering-The-Menu-Outside-An-Overlay-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+11.6 KB
...ts/Autocomplete-Rendering-The-Menu-Outside-An-Overlay-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+11.6 KB
...s/Autocomplete-Rendering-The-Menu-Outside-An-Overlay-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+11.5 KB
...utocomplete-Rendering-The-Menu-Outside-An-Overlay-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+11.6 KB
...ts-snapshots/Autocomplete-Rendering-The-Menu-Outside-An-Overlay-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+11.6 KB
...s/Autocomplete-Rendering-The-Menu-Outside-An-Overlay-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.8 KB
...s/Autocomplete.test.ts-snapshots/Autocomplete-Sx-Prop-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+12.1 KB
...nents/Autocomplete.test.ts-snapshots/Autocomplete-Sx-Prop-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.1 KB
...utocomplete.test.ts-snapshots/Autocomplete-Sx-Prop-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.8 KB
...s/components/Autocomplete.test.ts-snapshots/Autocomplete-Sx-Prop-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.8 KB
...s/Autocomplete.test.ts-snapshots/Autocomplete-Sx-Prop-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+11 KB
.../Autocomplete.test.ts-snapshots/Autocomplete-Sx-Prop-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+11.1 KB
...tocomplete.test.ts-snapshots/Autocomplete-Sx-Prop-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+11 KB
.../components/Autocomplete.test.ts-snapshots/Autocomplete-Sx-Prop-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+11 KB
.../Autocomplete.test.ts-snapshots/Autocomplete-Sx-Prop-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+13.8 KB
...omplete-With-Callback-When-Overlay-Open-State-Changes-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+15 KB
...utocomplete-With-Callback-When-Overlay-Open-State-Changes-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+13.2 KB
...lete-With-Callback-When-Overlay-Open-State-Changes-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+13.8 KB
...shots/Autocomplete-With-Callback-When-Overlay-Open-State-Changes-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+13.8 KB
...omplete-With-Callback-When-Overlay-Open-State-Changes-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+13.9 KB
...mplete-With-Callback-When-Overlay-Open-State-Changes-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+14 KB
...ete-With-Callback-When-Overlay-Open-State-Changes-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+13.9 KB
...hots/Autocomplete-With-Callback-When-Overlay-Open-State-Changes-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+13.9 KB
...mplete-With-Callback-When-Overlay-Open-State-Changes-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+14 KB
...plete.test.ts-snapshots/Autocomplete-With-Token-Input-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.3 KB
...ocomplete.test.ts-snapshots/Autocomplete-With-Token-Input-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+13.4 KB
...te.test.ts-snapshots/Autocomplete-With-Token-Input-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+14 KB
...nts/Autocomplete.test.ts-snapshots/Autocomplete-With-Token-Input-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+14 KB
...plete.test.ts-snapshots/Autocomplete-With-Token-Input-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.1 KB
...lete.test.ts-snapshots/Autocomplete-With-Token-Input-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.2 KB
...e.test.ts-snapshots/Autocomplete-With-Token-Input-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.1 KB
...ts/Autocomplete.test.ts-snapshots/Autocomplete-With-Token-Input-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.1 KB
...lete.test.ts-snapshots/Autocomplete-With-Token-Input-light-tritanopia-linux.png
Oops, something went wrong.
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,154 @@ | ||
import {test, expect, type Page} from '@playwright/test' | ||
import {visit} from '../test-helpers/storybook' | ||
import {themes} from '../test-helpers/themes' | ||
|
||
const stories: Array<{title: string; id: string; setup: (page: Page) => void}> = [ | ||
{ | ||
title: 'Default', | ||
id: 'components-autocomplete--default', | ||
setup: async page => { | ||
await page.keyboard.press('Tab') | ||
await page.keyboard.press('D') | ||
}, | ||
}, | ||
{ | ||
title: 'Add New Item', | ||
id: 'components-autocomplete-features--add-new-item', | ||
setup: async page => { | ||
await page.keyboard.press('Tab') | ||
await page.keyboard.press('D') | ||
}, | ||
}, | ||
{ | ||
title: 'Async Loading Of Items', | ||
id: 'components-autocomplete-features--async-loading-of-items', | ||
setup: async page => { | ||
await page.keyboard.press('Tab') | ||
await page.keyboard.press('D') | ||
}, | ||
}, | ||
{ | ||
title: 'Custom Overlay Menu Anchor', | ||
id: 'components-autocomplete-features--custom-overlay-menu-anchor', | ||
setup: async page => { | ||
await page.keyboard.press('Tab') | ||
await page.keyboard.press('D') | ||
}, | ||
}, | ||
{ | ||
title: 'Custom Search Filter Fn', | ||
id: 'components-autocomplete-features--custom-search-filter-fn', | ||
setup: async page => { | ||
await page.keyboard.press('Tab') | ||
await page.keyboard.press('D') | ||
}, | ||
}, | ||
{ | ||
title: 'Custom Sort After Menu Close', | ||
id: 'components-autocomplete-features--custom-sort-after-menu-close', | ||
setup: async page => { | ||
await page.keyboard.press('Tab') | ||
await page.keyboard.press('D') | ||
}, | ||
}, | ||
{ | ||
title: 'In A Dialog', | ||
id: 'components-autocomplete-features--in-a-dialog', | ||
setup: async page => { | ||
await page.keyboard.press('Tab') | ||
await page.keyboard.press('Enter') | ||
await expect(page.getByRole('dialog')).toBeVisible() | ||
await page.keyboard.press('Tab') | ||
await page.keyboard.press('D') | ||
}, | ||
}, | ||
{ | ||
title: 'In Overlay With Custom Scroll Container Ref', | ||
id: 'components-autocomplete-features--in-overlay-with-custom-scroll-container-ref', | ||
setup: async page => { | ||
await page.keyboard.press('Tab') | ||
await page.keyboard.press('Enter') | ||
await page.keyboard.press('D') | ||
}, | ||
}, | ||
{ | ||
title: 'Rendering The Menu Outside An Overlay', | ||
id: 'components-autocomplete-features--rendering-the-menu-outside-an-overlay', | ||
setup: async page => { | ||
await page.keyboard.press('Tab') | ||
await page.keyboard.press('D') | ||
}, | ||
}, | ||
{ | ||
title: 'With Callback When Overlay Open State Changes', | ||
id: 'components-autocomplete-features--with-callback-when-overlay-open-state-changes', | ||
setup: async page => { | ||
await page.keyboard.press('Tab') | ||
await page.keyboard.press('D') | ||
}, | ||
}, | ||
{ | ||
title: 'With Token Input', | ||
id: 'components-autocomplete-features--with-token-input', | ||
setup: async page => { | ||
await page.keyboard.press('Tab') | ||
await page.keyboard.press('D') | ||
}, | ||
}, | ||
{ | ||
title: 'Sx Prop', | ||
id: 'components-autocomplete-dev--sx-prop', | ||
setup: async page => { | ||
await page.keyboard.press('Tab') | ||
await page.keyboard.press('D') | ||
}, | ||
}, | ||
] | ||
|
||
test.describe('Autocomplete', () => { | ||
for (const story of stories) { | ||
test.describe(story.title, () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('@vrt', async ({page}) => { | ||
await visit(page, { | ||
id: story.id, | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
story.setup(page) | ||
|
||
await expect(page).toHaveScreenshot(`Autocomplete.${story.title}.${theme}.png`, {animations: 'disabled'}) | ||
}) | ||
|
||
test('@aat', async ({page}) => { | ||
await visit(page, { | ||
id: story.id, | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
story.setup(page) | ||
|
||
await expect(page).toHaveNoViolations({ | ||
rules: { | ||
'color-contrast': { | ||
enabled: | ||
theme !== 'dark_colorblind' && | ||
theme !== 'dark_dimmed' && | ||
theme !== 'light' && | ||
theme !== 'light_colorblind' && | ||
theme !== 'light_tritanopia', | ||
}, | ||
'aria-valid-attr-value': {enabled: false}, | ||
}, | ||
}) | ||
}) | ||
}) | ||
} | ||
}) | ||
} | ||
}) |
46 changes: 46 additions & 0 deletions
46
packages/react/src/Autocomplete/Autocomplete.dev.stories.tsx
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,46 @@ | ||
import React from 'react' | ||
import type {Meta} from '@storybook/react' | ||
|
||
import Autocomplete from './Autocomplete' | ||
import FormControl from '../FormControl' | ||
|
||
const autocompleteStoryMeta: Meta = { | ||
title: 'Components/Autocomplete/Dev', | ||
} as Meta | ||
|
||
export const SxProp = () => { | ||
return ( | ||
<form> | ||
<FormControl required={true}> | ||
<FormControl.Label id="autocompleteLabel">Label</FormControl.Label> | ||
<Autocomplete> | ||
<Autocomplete.Input | ||
sx={{ | ||
width: '100%', | ||
marginRight: '10px', | ||
borderColor: 'deeppink', | ||
}} | ||
size="medium" | ||
/> | ||
<Autocomplete.Overlay | ||
className="testCustomClassnameBorder" | ||
visibility="visible" | ||
sx={{ | ||
maxHeight: 'min(50vh, 280px)', | ||
overflowY: 'scroll', | ||
' div': { | ||
flexDirection: 'column', | ||
whiteSpace: 'pre-wrap', | ||
}, | ||
outline: '1px solid deeppink', | ||
}} | ||
> | ||
<Autocomplete.Menu items={[]} selectedItemIds={[]} aria-labelledby="autocompleteLabel" /> | ||
</Autocomplete.Overlay> | ||
</Autocomplete> | ||
</FormControl> | ||
</form> | ||
) | ||
} | ||
|
||
export default autocompleteStoryMeta |
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