-
Notifications
You must be signed in to change notification settings - Fork 583
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
54 additions
and
143 deletions.
There are no files selected for viewing
Binary file added
BIN
+7.03 KB
.playwright/snapshots/components/Text.test.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 modified
BIN
-351 Bytes
(95%)
.playwright/snapshots/components/Text.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 added
BIN
+7.03 KB
...ywright/snapshots/components/Text.test.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
...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 added
BIN
+7.21 KB
...right/snapshots/components/Text.test.ts-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.
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,150 +1,61 @@ | ||
import {test, expect} from '@playwright/test' | ||
import {visit} from '../test-helpers/storybook' | ||
|
||
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 | ||
|
||
// only testing light theme because this component is only concerned with text size and weight | ||
|
||
test.describe('Text', () => { | ||
test.describe('Default', () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text--default', | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Text.Default.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text--default', | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
|
||
test.describe('Small', () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text-features--size-small', | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Text.Small.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text-features--size-small', | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
for (const story of stories) { | ||
test.describe(story.title, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: story.id, | ||
}) | ||
|
||
test.describe('Medium', () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text-features--size-medium', | ||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Text.${story.title}.png`) | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Text.Medium.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text-features--size-medium', | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
|
||
test.describe('Large', () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text-features--size-large', | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Text.Large.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text-features--size-large', | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
|
||
test.describe('LightWeight', () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text-features--light-weight', | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Text.Light.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text-features--light-weight', | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
|
||
test.describe('NormalWeight', () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text-features--normal-weight', | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Text.Normal.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text-features--normal-weight', | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
|
||
test.describe('MediumWeight', () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text-features--medium-weight', | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Text.Medium.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text-features--medium-weight', | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
|
||
test.describe('SemiboldWeight', () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text-features--semibold-weight', | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Text.Semibold.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-text-features--semibold-weight', | ||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: story.id, | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
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.