-
Notifications
You must be signed in to change notification settings - Fork 536
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor(FilteredSearch): move files to folder, add storybook and e2e…
… tests. (#3125) * Move files to folder, add storybook and e2e tests. * Add aria-label to TextInput, fix docs reference. * Update generated/components.json * test(vrt): update snapshots * replace createRef with useRef (#3124) * replace createRef with useRef * changeset * missed null * refactor(FilterList): add files to folder, add storybook and e2e tests. (#3122) * Reorganize FilterList files into folder, add storybook and e2e tests. * Update generated/components.json * test(vrt): update snapshots --------- Co-authored-by: radglob <radglob@users.noreply.github.com> * Fix generated components. --------- Co-authored-by: radglob <radglob@users.noreply.github.com> Co-authored-by: Matthew Costabile <mattcosta7@github.com>
- Loading branch information
1 parent
7d774b1
commit 8243a2f
Showing
26 changed files
with
153 additions
and
23 deletions.
There are no files selected for viewing
Binary file added
BIN
+6.37 KB
...lteredSearch.test.ts-snapshots/FilteredSearch-Default-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
+6.36 KB
...s/FilteredSearch.test.ts-snapshots/FilteredSearch-Default-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
+6.4 KB
...redSearch.test.ts-snapshots/FilteredSearch-Default-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
+6.37 KB
...mponents/FilteredSearch.test.ts-snapshots/FilteredSearch-Default-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
+6.37 KB
...lteredSearch.test.ts-snapshots/FilteredSearch-Default-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
+6.45 KB
...teredSearch.test.ts-snapshots/FilteredSearch-Default-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
+6.5 KB
...edSearch.test.ts-snapshots/FilteredSearch-Default-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
+6.45 KB
...ponents/FilteredSearch.test.ts-snapshots/FilteredSearch-Default-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
+6.45 KB
...teredSearch.test.ts-snapshots/FilteredSearch-Default-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
+6.37 KB
...redSearch.test.ts-snapshots/FilteredSearch-Playground-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
+6.36 KB
...ilteredSearch.test.ts-snapshots/FilteredSearch-Playground-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
+6.4 KB
...Search.test.ts-snapshots/FilteredSearch-Playground-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
+6.37 KB
...nents/FilteredSearch.test.ts-snapshots/FilteredSearch-Playground-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
+6.37 KB
...redSearch.test.ts-snapshots/FilteredSearch-Playground-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
+6.45 KB
...edSearch.test.ts-snapshots/FilteredSearch-Playground-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
+6.5 KB
...earch.test.ts-snapshots/FilteredSearch-Playground-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
+6.45 KB
...ents/FilteredSearch.test.ts-snapshots/FilteredSearch-Playground-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
+6.45 KB
...edSearch.test.ts-snapshots/FilteredSearch-Playground-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.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import {test, expect} from '@playwright/test' | ||
import {visit} from '../test-helpers/storybook' | ||
import {themes} from '../test-helpers/themes' | ||
|
||
test.describe('FilteredSearch', () => { | ||
test.describe('Default', () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-filteredsearch--default', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`FilteredSearch.Default.${theme}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-filteredsearch--default', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
} | ||
}) | ||
|
||
test.describe('Playground', () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-filteredsearch--playground', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`FilteredSearch.Playground.${theme}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-filteredsearch--playground', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
} | ||
}) | ||
}) |
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
File renamed without changes.
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,48 @@ | ||
import React from 'react' | ||
import {Meta, ComponentStory} from '@storybook/react' | ||
import FilteredSearch from './FilteredSearch' | ||
import {ActionList} from '../ActionList' | ||
import {ActionMenu} from '../ActionMenu' | ||
import TextInput from '../TextInput' | ||
import {SearchIcon} from '@primer/octicons-react' | ||
|
||
export default { | ||
title: 'Components/FilteredSearch', | ||
component: FilteredSearch, | ||
} as Meta<typeof FilteredSearch> | ||
|
||
export const Default = () => ( | ||
<FilteredSearch> | ||
<ActionMenu> | ||
<ActionMenu.Button as="summary">Filter</ActionMenu.Button> | ||
<ActionMenu.Overlay> | ||
<ActionList> | ||
<ActionList.Item>Item 1</ActionList.Item> | ||
<ActionList.Item>Item 2</ActionList.Item> | ||
<ActionList.Item>Item 3</ActionList.Item> | ||
</ActionList> | ||
</ActionMenu.Overlay> | ||
</ActionMenu> | ||
<TextInput aria-label="filtered-search" leadingVisual={SearchIcon} /> | ||
</FilteredSearch> | ||
) | ||
|
||
export const Playground: ComponentStory<typeof FilteredSearch> = args => ( | ||
<FilteredSearch {...args}> | ||
<ActionMenu> | ||
<ActionMenu.Button as="summary">Filter</ActionMenu.Button> | ||
<ActionMenu.Overlay> | ||
<ActionList> | ||
<ActionList.Item>Item 1</ActionList.Item> | ||
<ActionList.Item>Item 2</ActionList.Item> | ||
<ActionList.Item>Item 3</ActionList.Item> | ||
</ActionList> | ||
</ActionMenu.Overlay> | ||
</ActionMenu> | ||
<TextInput aria-label="filtered-search" leadingVisual={SearchIcon} /> | ||
</FilteredSearch> | ||
) | ||
|
||
Playground.args = {} | ||
|
||
Playground.argTypes = {} |
6 changes: 3 additions & 3 deletions
6
src/FilteredSearch.tsx → src/FilteredSearch/FilteredSearch.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
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 @@ | ||
export {default, FilteredSearchProps} from './FilteredSearch' |