-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ui mob pair * Create clever-birds-press.md * test(vrt): update snapshots * fix * reset * test(vrt): update snapshots * try to only test light * reset * test(vrt): update snapshots * fix test * test(vrt): update snapshots * lint * Update packages/react/src/Heading/Heading.docs.json Co-authored-by: Siddharth Kshetrapal <siddharthkp@github.com> * fix typo * lint * fix story name * reset * fix test name --------- Co-authored-by: langermank <langermank@users.noreply.github.com> Co-authored-by: Siddharth Kshetrapal <siddharthkp@github.com> Co-authored-by: Josh Black <joshblack@github.com>
- Loading branch information
1 parent
c0425ff
commit 84d1604
Showing
11 changed files
with
136 additions
and
29 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": patch | ||
--- | ||
|
||
Add `variant` prop to Heading for small, medium and large styles |
Binary file added
BIN
+10.7 KB
...wright/snapshots/components/Heading.test.ts-snapshots/Heading-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 added
BIN
+9.58 KB
.playwright/snapshots/components/Heading.test.ts-snapshots/Heading-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 added
BIN
+8.06 KB
...ywright/snapshots/components/Heading.test.ts-snapshots/Heading-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 added
BIN
+7.29 KB
.playwright/snapshots/components/Heading.test.ts-snapshots/Heading-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,33 +1,74 @@ | ||
import {test, expect} from '@playwright/test' | ||
import {visit} from '../test-helpers/storybook' | ||
import {themes} from '../test-helpers/themes' | ||
|
||
test.describe('Heading', () => { | ||
test.describe('Default', () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-heading--default', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Heading.Default.${theme}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-heading--default', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
} | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-heading--default', | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Heading.Default.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-heading--default', | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
|
||
test.describe('Small', () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-heading-features--small', | ||
}) | ||
|
||
expect(await page.screenshot()).toMatchSnapshot(`Heading.Small.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-heading-features--small', | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
|
||
test.describe('Medium', () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-heading-features--medium', | ||
}) | ||
|
||
expect(await page.screenshot()).toMatchSnapshot(`Heading.Medium.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-heading-features--medium', | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
|
||
test.describe('Large', () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-heading-features--large', | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Heading.Large.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-heading-features--large', | ||
}) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react' | ||
import type {StoryFn} from '@storybook/react' | ||
import Heading from './Heading' | ||
|
||
export default { | ||
title: 'Components/Heading/Features', | ||
} | ||
|
||
export const TestSx: StoryFn<typeof Heading> = () => ( | ||
<Heading | ||
sx={{ | ||
fontSize: 2, | ||
fontWeight: 'normal', | ||
}} | ||
> | ||
Heading with sx override | ||
</Heading> | ||
) | ||
|
||
export const Small: StoryFn<typeof Heading> = () => <Heading variant="small">Small heading</Heading> | ||
|
||
export const Medium: StoryFn<typeof Heading> = () => <Heading variant="medium">Medium heading</Heading> | ||
|
||
export const Large: StoryFn<typeof Heading> = () => <Heading variant="large">Large heading</Heading> |
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