-
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(FilterList): add files to folder, add storybook and e2e test…
…s. (#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>
- Loading branch information
Showing
26 changed files
with
185 additions
and
50 deletions.
There are no files selected for viewing
Binary file added
BIN
+9.58 KB
...nents/FilterList.test.ts-snapshots/FilterList-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
+9.5 KB
...omponents/FilterList.test.ts-snapshots/FilterList-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
+9.7 KB
...ts/FilterList.test.ts-snapshots/FilterList-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
+9.58 KB
...shots/components/FilterList.test.ts-snapshots/FilterList-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
+9.58 KB
...nents/FilterList.test.ts-snapshots/FilterList-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
+9.65 KB
...ents/FilterList.test.ts-snapshots/FilterList-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
+9.68 KB
...s/FilterList.test.ts-snapshots/FilterList-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
+9.65 KB
...hots/components/FilterList.test.ts-snapshots/FilterList-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
+9.65 KB
...ents/FilterList.test.ts-snapshots/FilterList-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
+9.58 KB
...ts/FilterList.test.ts-snapshots/FilterList-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
+9.5 KB
...onents/FilterList.test.ts-snapshots/FilterList-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
+9.7 KB
...FilterList.test.ts-snapshots/FilterList-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
+9.58 KB
...ts/components/FilterList.test.ts-snapshots/FilterList-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
+9.58 KB
...ts/FilterList.test.ts-snapshots/FilterList-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
+9.65 KB
...s/FilterList.test.ts-snapshots/FilterList-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
+9.68 KB
...ilterList.test.ts-snapshots/FilterList-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
+9.65 KB
...s/components/FilterList.test.ts-snapshots/FilterList-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
+9.65 KB
...s/FilterList.test.ts-snapshots/FilterList-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('FilterList', () => { | ||
test.describe('Default', () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-filterlist--default', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`FilterList.Default.${theme}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-filterlist--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-filterlist--playground', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`FilterList.Playground.${theme}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-filterlist--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,53 @@ | ||
import React, {useState} from 'react' | ||
import {Meta, ComponentStory} from '@storybook/react' | ||
import FilterList from './FilterList' | ||
|
||
export default { | ||
title: 'Components/FilterList', | ||
component: FilterList, | ||
} as Meta<typeof FilterList> | ||
|
||
export const Default = () => { | ||
const [selectedIndex, setSelectedIndex] = useState(0) | ||
return ( | ||
<FilterList> | ||
<FilterList.Item selected={selectedIndex === 0} onClick={() => setSelectedIndex(0)} count={32}> | ||
First Filter | ||
</FilterList.Item> | ||
<FilterList.Item selected={selectedIndex === 1} onClick={() => setSelectedIndex(1)} count={16}> | ||
Second Filter | ||
</FilterList.Item> | ||
<FilterList.Item selected={selectedIndex === 2} onClick={() => setSelectedIndex(2)}> | ||
Third Filter | ||
</FilterList.Item> | ||
</FilterList> | ||
) | ||
} | ||
|
||
export const Playground: ComponentStory<typeof FilterList> = args => { | ||
const [selectedIndex, setSelectedIndex] = useState(0) | ||
return ( | ||
<FilterList {...args}> | ||
<FilterList.Item selected={selectedIndex === 0} onClick={() => setSelectedIndex(0)} count={32}> | ||
First Filter | ||
</FilterList.Item> | ||
<FilterList.Item selected={selectedIndex === 1} onClick={() => setSelectedIndex(1)} count={16}> | ||
Second Filter | ||
</FilterList.Item> | ||
<FilterList.Item selected={selectedIndex === 2} onClick={() => setSelectedIndex(2)}> | ||
Third Filter | ||
</FilterList.Item> | ||
</FilterList> | ||
) | ||
} | ||
|
||
Playground.args = {} | ||
|
||
Playground.argTypes = { | ||
sx: { | ||
controls: false, | ||
table: { | ||
disabled: true, | ||
}, | ||
}, | ||
} |
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, FilterListProps, FilterListItemProps} from './FilterList' |