-
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.
Token: Reformat stories and add e2e tests (#3002)
* Token: Reformat stories and add e2e tests * Update generated/components.json * fix imports * snaps * test(vrt): update snapshots --------- Co-authored-by: broccolinisoup <broccolinisoup@users.noreply.github.com>
- Loading branch information
1 parent
45107bc
commit 6c4485e
Showing
83 changed files
with
424 additions
and
290 deletions.
There are no files selected for viewing
Binary file added
BIN
+7.24 KB
...ken.test.ts-snapshots/Token-Default-Issue-Label-Token-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
+7.2 KB
...s/Token.test.ts-snapshots/Token-Default-Issue-Label-Token-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
+7.25 KB
....test.ts-snapshots/Token-Default-Issue-Label-Token-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
+7.24 KB
...mponents/Token.test.ts-snapshots/Token-Default-Issue-Label-Token-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
+7.24 KB
...ken.test.ts-snapshots/Token-Default-Issue-Label-Token-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.93 KB
...en.test.ts-snapshots/Token-Default-Issue-Label-Token-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.93 KB
...test.ts-snapshots/Token-Default-Issue-Label-Token-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.98 KB
...ponents/Token.test.ts-snapshots/Token-Default-Issue-Label-Token-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.93 KB
...en.test.ts-snapshots/Token-Default-Issue-Label-Token-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.17 KB
...hots/components/Token.test.ts-snapshots/Token-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.14 KB
...napshots/components/Token.test.ts-snapshots/Token-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.2 KB
...s/components/Token.test.ts-snapshots/Token-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.17 KB
...right/snapshots/components/Token.test.ts-snapshots/Token-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.17 KB
...hots/components/Token.test.ts-snapshots/Token-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.2 KB
...ots/components/Token.test.ts-snapshots/Token-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.31 KB
.../components/Token.test.ts-snapshots/Token-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.2 KB
...ight/snapshots/components/Token.test.ts-snapshots/Token-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.2 KB
...ots/components/Token.test.ts-snapshots/Token-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.29 KB
...s-snapshots/Token-Issue-Label-Token-With-On-Remove-Fn-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.17 KB
...st.ts-snapshots/Token-Issue-Label-Token-With-On-Remove-Fn-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.3 KB
...napshots/Token-Issue-Label-Token-With-On-Remove-Fn-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.29 KB
...oken.test.ts-snapshots/Token-Issue-Label-Token-With-On-Remove-Fn-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.29 KB
...s-snapshots/Token-Issue-Label-Token-With-On-Remove-Fn-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
+8.8 KB
...-snapshots/Token-Issue-Label-Token-With-On-Remove-Fn-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
+8.8 KB
...apshots/Token-Issue-Label-Token-With-On-Remove-Fn-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
+8.94 KB
...ken.test.ts-snapshots/Token-Issue-Label-Token-With-On-Remove-Fn-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+8.8 KB
...-snapshots/Token-Issue-Label-Token-With-On-Remove-Fn-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.66 KB
.../components/Token.test.ts-snapshots/Token-Large-Token-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.61 KB
...hots/components/Token.test.ts-snapshots/Token-Large-Token-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.78 KB
...mponents/Token.test.ts-snapshots/Token-Large-Token-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.66 KB
...t/snapshots/components/Token.test.ts-snapshots/Token-Large-Token-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.66 KB
.../components/Token.test.ts-snapshots/Token-Large-Token-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.73 KB
...components/Token.test.ts-snapshots/Token-Large-Token-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.95 KB
...ponents/Token.test.ts-snapshots/Token-Large-Token-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.73 KB
.../snapshots/components/Token.test.ts-snapshots/Token-Large-Token-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.73 KB
...components/Token.test.ts-snapshots/Token-Large-Token-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.02 KB
.../components/Token.test.ts-snapshots/Token-Small-Token-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.99 KB
...hots/components/Token.test.ts-snapshots/Token-Small-Token-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.06 KB
...mponents/Token.test.ts-snapshots/Token-Small-Token-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.02 KB
...t/snapshots/components/Token.test.ts-snapshots/Token-Small-Token-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.02 KB
.../components/Token.test.ts-snapshots/Token-Small-Token-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.06 KB
...components/Token.test.ts-snapshots/Token-Small-Token-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.08 KB
...ponents/Token.test.ts-snapshots/Token-Small-Token-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.06 KB
.../snapshots/components/Token.test.ts-snapshots/Token-Small-Token-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.06 KB
...components/Token.test.ts-snapshots/Token-Small-Token-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.6 KB
...ken.test.ts-snapshots/Token-Token-With-Leading-Visual-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.56 KB
...s/Token.test.ts-snapshots/Token-Token-With-Leading-Visual-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.58 KB
....test.ts-snapshots/Token-Token-With-Leading-Visual-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.6 KB
...mponents/Token.test.ts-snapshots/Token-Token-With-Leading-Visual-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.6 KB
...ken.test.ts-snapshots/Token-Token-With-Leading-Visual-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.62 KB
...en.test.ts-snapshots/Token-Token-With-Leading-Visual-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.68 KB
...test.ts-snapshots/Token-Token-With-Leading-Visual-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.62 KB
...ponents/Token.test.ts-snapshots/Token-Token-With-Leading-Visual-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.62 KB
...en.test.ts-snapshots/Token-Token-With-Leading-Visual-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+9.28 KB
...Token.test.ts-snapshots/Token-Token-With-On-Remove-Fn-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+9.12 KB
...nts/Token.test.ts-snapshots/Token-Token-With-On-Remove-Fn-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+9.33 KB
...en.test.ts-snapshots/Token-Token-With-On-Remove-Fn-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+9.28 KB
...components/Token.test.ts-snapshots/Token-Token-With-On-Remove-Fn-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+9.28 KB
...Token.test.ts-snapshots/Token-Token-With-On-Remove-Fn-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+9.44 KB
...oken.test.ts-snapshots/Token-Token-With-On-Remove-Fn-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+9.5 KB
...n.test.ts-snapshots/Token-Token-With-On-Remove-Fn-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+9.44 KB
...omponents/Token.test.ts-snapshots/Token-Token-With-On-Remove-Fn-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+9.44 KB
...oken.test.ts-snapshots/Token-Token-With-On-Remove-Fn-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.66 KB
...components/Token.test.ts-snapshots/Token-Xlarge-Token-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.61 KB
...ots/components/Token.test.ts-snapshots/Token-Xlarge-Token-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.78 KB
...ponents/Token.test.ts-snapshots/Token-Xlarge-Token-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.66 KB
.../snapshots/components/Token.test.ts-snapshots/Token-Xlarge-Token-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.66 KB
...components/Token.test.ts-snapshots/Token-Xlarge-Token-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.73 KB
...omponents/Token.test.ts-snapshots/Token-Xlarge-Token-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.95 KB
...onents/Token.test.ts-snapshots/Token-Xlarge-Token-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.73 KB
...snapshots/components/Token.test.ts-snapshots/Token-Xlarge-Token-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.73 KB
...omponents/Token.test.ts-snapshots/Token-Xlarge-Token-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,229 @@ | ||
import {test, expect} from '@playwright/test' | ||
import {visit} from '../test-helpers/storybook' | ||
import {themes} from '../test-helpers/themes' | ||
|
||
test.describe('Token', () => { | ||
test.describe('Default', () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-token--default', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Token.Default.${theme}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-token--default', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
} | ||
}) | ||
|
||
test.describe('Small Token', () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-token-features--small-token', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Token.Small Token.${theme}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-token-features--small-token', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
} | ||
}) | ||
|
||
test.describe('Large Token', () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-token-features--large-token', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Token.Large Token.${theme}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-token-features--large-token', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
} | ||
}) | ||
|
||
test.describe('Xlarge Token', () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-token-features--x-large-token', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Token.Xlarge Token.${theme}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-token-features--x-large-token', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
} | ||
}) | ||
|
||
test.describe('Token With Leading Visual', () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-token-features--token-with-leading-visual', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Token.Token With Leading Visual.${theme}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-token-features--token-with-leading-visual', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
} | ||
}) | ||
|
||
test.describe('Token With On Remove Fn', () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-token-features--token-with-on-remove-fn', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Token.Token With On Remove Fn.${theme}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-token-features--token-with-on-remove-fn', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
} | ||
}) | ||
|
||
test.describe('Default Issue Label Token', () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-token-features--default-issue-label-token', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Token.Default Issue Label Token.${theme}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-token-features--default-issue-label-token', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
} | ||
}) | ||
|
||
test.describe('Issue Label Token With On Remove Fn', () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-token-features--issue-label-token-with-on-remove-fn', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Token.Issue Label Token With On Remove Fn.${theme}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-token-features--issue-label-token-with-on-remove-fn', | ||
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
Oops, something went wrong.