Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing stories, simplify Autocomplete stories #5127

Merged
merged 21 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
292c33c
adds missing stories for Select, Textarea, and TextInputWithTokens
mperrotti Oct 10, 2024
ac62c32
simplifies Autocomplete stories
mperrotti Oct 15, 2024
a087134
Merge branch 'main' of github.com:primer/react into mp/story-improvem…
mperrotti Oct 15, 2024
738c9de
Merge branch 'main' into mp/story-improvements-10.2024
mperrotti Oct 15, 2024
dd3ea68
manually updates snapshot tests
mperrotti Oct 15, 2024
a3e5f1c
Merge branch 'main' of github.com:primer/react into mp/story-improvem…
mperrotti Oct 15, 2024
9c31926
Merge branch 'mp/story-improvements-10.2024' of github.com:primer/rea…
mperrotti Oct 15, 2024
f38bc0f
test(vrt): update snapshots
mperrotti Oct 17, 2024
df2a66d
Merge branch 'main' into mp/story-improvements-10.2024
mperrotti Oct 18, 2024
d1e1741
test(vrt): update snapshots
mperrotti Oct 18, 2024
9242a61
test(vrt): update snapshots
mperrotti Oct 18, 2024
725ac5c
Merge branch 'main' into mp/story-improvements-10.2024
mperrotti Oct 18, 2024
4a82bd8
disable Textarea animations for VRTs
mperrotti Oct 21, 2024
0599d1c
Merge branch 'mp/story-improvements-10.2024' of github.com:primer/rea…
mperrotti Oct 21, 2024
e9d124b
Merge branch 'main' of github.com:primer/react into mp/story-improvem…
mperrotti Oct 21, 2024
d0d794a
Merge branch 'main' into mp/story-improvements-10.2024
mperrotti Oct 21, 2024
2477b96
test(vrt): update snapshots
mperrotti Oct 21, 2024
85a7b92
disables Select animations for VRTs
mperrotti Oct 22, 2024
26c9188
Merge branch 'mp/story-improvements-10.2024' of github.com:primer/rea…
mperrotti Oct 22, 2024
ab5c6b0
test(vrt): update snapshots
mperrotti Oct 22, 2024
bf87c9f
Merge branch 'main' into mp/story-improvements-10.2024
mperrotti Oct 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
411 changes: 76 additions & 335 deletions e2e/components/Select.test.ts

Large diffs are not rendered by default.

139 changes: 61 additions & 78 deletions e2e/components/TextInputWithTokens.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,88 +2,71 @@ import {test, expect} from '@playwright/test'
import {visit} from '../test-helpers/storybook'
import {themes} from '../test-helpers/themes'

test.describe('TextInputWithTokens', () => {
test.describe('Default', () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'components-textinputwithtokens--default',
globals: {
colorScheme: theme,
},
})

// Default state
expect(await page.screenshot()).toMatchSnapshot(`TextInputWithTokens.Default.${theme}.png`)
})

test('axe @aat', async ({page}) => {
await visit(page, {
id: 'components-textinputwithtokens--default',
globals: {
colorScheme: theme,
},
})
await expect(page).toHaveNoViolations()
})
})
}
})

test.describe('With Leading Visual', () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'components-textinputwithtokens-features--with-leading-visual',
globals: {
colorScheme: theme,
},
})

// Default state
expect(await page.screenshot()).toMatchSnapshot(`TextInputWithTokens.With Leading Visual.${theme}.png`)
})
const stories = [
{
id: 'components-textinputwithtokens--default',
title: 'Default',
},
{
id: 'components-textinputwithtokens-features--with-leading-visual',
title: 'With Leading Visual',
},
{
id: 'components-textinputwithtokens-features--with-trailing-visual',
title: 'With Trailing Visual',
},
{
id: 'components-textinputwithtokens-features--max-height',
title: 'Max Height',
},
{
id: 'components-textinputwithtokens-features--prevent-tokens-from-wrapping',
title: 'Prevent Tokens From Wrapping',
},
{
id: 'components-textinputwithtokens-features--size',
title: 'Size',
},
{
id: 'components-textinputwithtokens-features--truncated',
title: 'Truncated',
},
] as const

test('axe @aat', async ({page}) => {
await visit(page, {
id: 'components-textinputwithtokens-features--with-leading-visual',
globals: {
colorScheme: theme,
},
})
await expect(page).toHaveNoViolations()
})
})
}
})
test.describe('TextInputWithTokens', () => {
for (const story of stories) {
test.describe(story.title, () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: story.id,
globals: {
colorScheme: theme,
},
})

test.describe('With Trailing Visual', () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'components-textinputwithtokens-features--with-trailing-visual',
globals: {
colorScheme: theme,
},
// Default state
expect(await page.screenshot()).toMatchSnapshot(`TextInputWithTokens.${story.title}.${theme}.png`)
})

// Default state
expect(await page.screenshot()).toMatchSnapshot(`TextInputWithTokens.With Trailing Visual.${theme}.png`)
})

test('axe @aat', async ({page}) => {
await visit(page, {
id: 'components-textinputwithtokens-features--with-trailing-visual',
globals: {
colorScheme: theme,
},
test('axe @aat', async ({page}) => {
await visit(page, {
id: story.id,
globals: {
colorScheme: theme,
},
})
await expect(page).toHaveNoViolations({
rules: {
'color-contrast': {
enabled: theme !== 'dark_dimmed',
},
},
})
})
await expect(page).toHaveNoViolations()
})
})
}
})
}
})
}
})
Loading
Loading