-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add size and weight props * add fallbacks * polymorphic? * test ci * snapshots * test(vrt): update snapshots * lint * Create gold-cups-explode.md * fix playground * refactor(e2e): update Text e2e test --------- Co-authored-by: langermank <langermank@users.noreply.github.com> Co-authored-by: Josh Black <joshblack@users.noreply.github.com>
- Loading branch information
1 parent
e74e581
commit 7ce1fda
Showing
30 changed files
with
230 additions
and
64 deletions.
There are no files selected for viewing
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,5 @@ | ||
--- | ||
"@primer/react": minor | ||
--- | ||
|
||
Add `size` and `weight` props to `Text` |
Binary file removed
BIN
-6.75 KB
...pshots/components/Text.test.ts-snapshots/Text-Default-dark-colorblind-linux.png
Binary file not shown.
Binary file removed
BIN
-6.75 KB
...ots/components/Text.test.ts-snapshots/Text-Default-dark-high-contrast-linux.png
Binary file not shown.
Binary file removed
BIN
-6.75 KB
...ywright/snapshots/components/Text.test.ts-snapshots/Text-Default-dark-linux.png
Binary file not shown.
Binary file removed
BIN
-6.75 KB
...pshots/components/Text.test.ts-snapshots/Text-Default-dark-tritanopia-linux.png
Binary file not shown.
Binary file renamed
BIN
+6.76 KB
...snapshots/Text-Playground-light-linux.png → ....test.ts-snapshots/Text-Default-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 renamed
BIN
+6.82 KB
...pshots/Text-Default-dark-dimmed-linux.png → ...xt.test.ts-snapshots/Text-Large-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 renamed
BIN
+6.75 KB
...t-Playground-dark-high-contrast-linux.png → ...xt.test.ts-snapshots/Text-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 renamed
BIN
+6.77 KB
...ext-Default-light-high-contrast-linux.png → ...t.ts-snapshots/Text-LightWeight-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 renamed
BIN
+6.75 KB
...-Playground-light-high-contrast-linux.png → ...t.test.ts-snapshots/Text-Medium-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 renamed
BIN
+6.76 KB
...ts-snapshots/Text-Default-light-linux.png → ....ts-snapshots/Text-MediumWeight-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.03 KB
.playwright/snapshots/components/Text.test.ts-snapshots/Text-Normal-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.03 KB
...ywright/snapshots/components/Text.test.ts-snapshots/Text-NormalWeight-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 removed
BIN
-6.76 KB
...ots/components/Text.test.ts-snapshots/Text-Playground-dark-colorblind-linux.png
Binary file not shown.
Binary file removed
BIN
-6.78 KB
...apshots/components/Text.test.ts-snapshots/Text-Playground-dark-dimmed-linux.png
Binary file not shown.
Binary file removed
BIN
-6.76 KB
...ight/snapshots/components/Text.test.ts-snapshots/Text-Playground-dark-linux.png
Binary file not shown.
Binary file removed
BIN
-6.76 KB
...ots/components/Text.test.ts-snapshots/Text-Playground-dark-tritanopia-linux.png
Binary file not shown.
Binary file removed
BIN
-6.76 KB
...ts/components/Text.test.ts-snapshots/Text-Playground-light-colorblind-linux.png
Binary file not shown.
Binary file removed
BIN
-6.76 KB
...ts/components/Text.test.ts-snapshots/Text-Playground-light-tritanopia-linux.png
Binary file not shown.
Binary file renamed
BIN
+6.77 KB
...s/Text-Default-light-tritanopia-linux.png → ...test.ts-snapshots/Text-Semibold-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 renamed
BIN
+6.77 KB
...s/Text-Default-light-colorblind-linux.png → ...s-snapshots/Text-SemiboldWeight-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.18 KB
.playwright/snapshots/components/Text.test.ts-snapshots/Text-Small-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,61 @@ | ||
import {test, expect} from '@playwright/test' | ||
import {visit} from '../test-helpers/storybook' | ||
import {themes} from '../test-helpers/themes' | ||
|
||
test.describe('Text', () => { | ||
test.describe('Default', () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text--default', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
const stories = [ | ||
{ | ||
title: 'Default', | ||
id: 'components-text--default', | ||
}, | ||
{ | ||
title: 'Small', | ||
id: 'components-text-features--size-small', | ||
}, | ||
{ | ||
title: 'Medium', | ||
id: 'components-text-features--size-medium', | ||
}, | ||
{ | ||
title: 'Large', | ||
id: 'components-text-features--size-large', | ||
}, | ||
{ | ||
title: 'LightWeight', | ||
id: 'components-text-features--light-weight', | ||
}, | ||
{ | ||
title: 'NormalWeight', | ||
id: 'components-text-features--normal-weight', | ||
}, | ||
{ | ||
title: 'MediumWeight', | ||
id: 'components-text-features--medium-weight', | ||
}, | ||
{ | ||
title: 'SemiboldWeight', | ||
id: 'components-text-features--semibold-weight', | ||
}, | ||
] as const | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Text.Default.${theme}.png`) | ||
}) | ||
// only testing light theme because this component is only concerned with text size and weight | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text--default', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
test.describe('Text', () => { | ||
for (const story of stories) { | ||
test.describe(story.title, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: story.id, | ||
}) | ||
}) | ||
} | ||
}) | ||
|
||
test.describe('Playground', () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text--playground', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Text.Playground.${theme}.png`) | ||
}) | ||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Text.${story.title}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text--playground', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: story.id, | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
} | ||
}) | ||
}) | ||
} | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
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