-
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(CircleOcticon): Move files to folder, add storybook and e2e …
…tests. (#3119) * Reorganize CircleOcticon files, add story and e2e tests. * Add index file. * Update generated/components.json * refactor(CircleBadge): move files into folder, add e2e tests. (#3118) * Reorganize CircleBadge, add e2e tests. * Update generated/components.json * test(vrt): update snapshots * Update docs reference. --------- Co-authored-by: radglob <[email protected]> * Update generated/components.json * test(vrt): update snapshots --------- Co-authored-by: radglob <[email protected]>
- Loading branch information
Showing
26 changed files
with
167 additions
and
26 deletions.
There are no files selected for viewing
Binary file added
BIN
+5.61 KB
...CircleOcticon.test.ts-snapshots/CircleOcticon-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
+5.67 KB
...nts/CircleOcticon.test.ts-snapshots/CircleOcticon-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
+5.61 KB
...cleOcticon.test.ts-snapshots/CircleOcticon-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
+5.63 KB
...components/CircleOcticon.test.ts-snapshots/CircleOcticon-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
+5.61 KB
...CircleOcticon.test.ts-snapshots/CircleOcticon-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
+5.63 KB
...ircleOcticon.test.ts-snapshots/CircleOcticon-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
+5.65 KB
...leOcticon.test.ts-snapshots/CircleOcticon-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
+5.63 KB
...omponents/CircleOcticon.test.ts-snapshots/CircleOcticon-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
+5.63 KB
...ircleOcticon.test.ts-snapshots/CircleOcticon-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
+5.61 KB
...cleOcticon.test.ts-snapshots/CircleOcticon-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
+5.67 KB
.../CircleOcticon.test.ts-snapshots/CircleOcticon-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
+5.61 KB
...Octicon.test.ts-snapshots/CircleOcticon-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
+5.63 KB
...ponents/CircleOcticon.test.ts-snapshots/CircleOcticon-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
+5.61 KB
...cleOcticon.test.ts-snapshots/CircleOcticon-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
+5.63 KB
...leOcticon.test.ts-snapshots/CircleOcticon-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
+5.65 KB
...cticon.test.ts-snapshots/CircleOcticon-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
+5.63 KB
...onents/CircleOcticon.test.ts-snapshots/CircleOcticon-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
+5.63 KB
...leOcticon.test.ts-snapshots/CircleOcticon-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('CircleOcticon', () => { | ||
test.describe('Default', () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-circleocticon--default', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`CircleOcticon.Default.${theme}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-circleocticon--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-circleocticon--playground', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`CircleOcticon.Playground.${theme}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-circleocticon--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,59 @@ | ||
import React from 'react' | ||
import {Meta, ComponentStory} from '@storybook/react' | ||
import CircleOcticon from './CircleOcticon' | ||
import {CheckIcon} from '@primer/octicons-react' | ||
|
||
export default { | ||
title: 'Components/CircleOcticon', | ||
component: CircleOcticon, | ||
} as Meta<typeof CircleOcticon> | ||
|
||
export const Default = () => ( | ||
<CircleOcticon icon={CheckIcon} size={32} sx={{backgroundColor: 'success.fg', color: 'fg.onEmphasis'}} /> | ||
) | ||
|
||
export const Playground: ComponentStory<typeof CircleOcticon> = args => <CircleOcticon {...args} /> | ||
|
||
Playground.args = { | ||
icon: CheckIcon, | ||
size: 32, | ||
sx: {backgroundColor: 'success.fg', color: 'fg.onEmphasis'}, | ||
} | ||
|
||
Playground.argTypes = { | ||
icon: { | ||
controls: false, | ||
table: { | ||
disable: true, | ||
}, | ||
}, | ||
size: { | ||
controls: { | ||
type: 'number', | ||
}, | ||
}, | ||
sx: { | ||
controls: false, | ||
table: { | ||
disable: true, | ||
}, | ||
}, | ||
as: { | ||
controls: false, | ||
table: { | ||
disable: true, | ||
}, | ||
}, | ||
ref: { | ||
controls: false, | ||
table: { | ||
disable: true, | ||
}, | ||
}, | ||
theme: { | ||
controls: false, | ||
table: { | ||
disable: 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, CircleOcticonProps} from './CircleOcticon' |