-
Notifications
You must be signed in to change notification settings - Fork 537
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(Pagination): Add e2e snapshot tests for pagination (#5297)
* add snapshot tests * fix e2e test * test(vrt): update snapshots --------- Co-authored-by: randall-krauskopf <randall-krauskopf@users.noreply.github.com>
- Loading branch information
1 parent
e89edbc
commit 346ad0c
Showing
29 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+8.73 KB
...ponents/Pagination.test.ts-snapshots/Pagehead-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
+8.72 KB
.../components/Pagination.test.ts-snapshots/Pagehead-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
+8.73 KB
...ents/Pagination.test.ts-snapshots/Pagehead-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
+8.73 KB
...apshots/components/Pagination.test.ts-snapshots/Pagehead-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
+8.73 KB
...ponents/Pagination.test.ts-snapshots/Pagehead-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
+8.65 KB
...onents/Pagination.test.ts-snapshots/Pagehead-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
+8.7 KB
...nts/Pagination.test.ts-snapshots/Pagehead-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
+8.65 KB
...pshots/components/Pagination.test.ts-snapshots/Pagehead-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
+8.65 KB
...onents/Pagination.test.ts-snapshots/Pagehead-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
+8.73 KB
...nts/Pagination.test.ts-snapshots/Pagehead-Dev-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
+8.72 KB
...ponents/Pagination.test.ts-snapshots/Pagehead-Dev-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
+8.73 KB
.../Pagination.test.ts-snapshots/Pagehead-Dev-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
+8.73 KB
...ots/components/Pagination.test.ts-snapshots/Pagehead-Dev-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
+8.73 KB
...nts/Pagination.test.ts-snapshots/Pagehead-Dev-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
+8.65 KB
...ts/Pagination.test.ts-snapshots/Pagehead-Dev-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
+8.7 KB
...Pagination.test.ts-snapshots/Pagehead-Dev-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
+8.65 KB
...ts/components/Pagination.test.ts-snapshots/Pagehead-Dev-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
+8.65 KB
...ts/Pagination.test.ts-snapshots/Pagehead-Dev-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
+6.49 KB
...gination.test.ts-snapshots/Pagehead-Hide-Page-Numbers-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.5 KB
...s/Pagination.test.ts-snapshots/Pagehead-Hide-Page-Numbers-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.54 KB
...ation.test.ts-snapshots/Pagehead-Hide-Page-Numbers-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.49 KB
...mponents/Pagination.test.ts-snapshots/Pagehead-Hide-Page-Numbers-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.49 KB
...gination.test.ts-snapshots/Pagehead-Hide-Page-Numbers-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.46 KB
...ination.test.ts-snapshots/Pagehead-Hide-Page-Numbers-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.52 KB
...tion.test.ts-snapshots/Pagehead-Hide-Page-Numbers-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.46 KB
...ponents/Pagination.test.ts-snapshots/Pagehead-Hide-Page-Numbers-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+6.46 KB
...ination.test.ts-snapshots/Pagehead-Hide-Page-Numbers-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,50 @@ | ||
import {test, expect} from '@playwright/test' | ||
import {visit} from '../test-helpers/storybook' | ||
import {themes} from '../test-helpers/themes' | ||
|
||
const stories = [ | ||
{ | ||
title: 'Default', | ||
id: 'components-pagination--default', | ||
}, | ||
{ | ||
title: 'Dev Default', | ||
id: 'components-pagination-dev--dev-default', | ||
}, | ||
{ | ||
title: 'Hide Page Numbers', | ||
id: 'components-pagination-features--hide-page-numbers', | ||
}, | ||
] as const | ||
|
||
test.describe('Pagination', () => { | ||
for (const story of stories) { | ||
test.describe(story.id, () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: story.id, | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Pagehead.${story.title}.${theme}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: story.id, | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react' | ||
import type {Meta} from '@storybook/react' | ||
import type {ComponentProps} from '../utils/types' | ||
import Pagination from './Pagination' | ||
|
||
export default { | ||
title: 'Components/Pagination/Dev', | ||
component: Pagination, | ||
} as Meta<ComponentProps<typeof Pagination>> | ||
|
||
export const DevDefault = () => ( | ||
<Pagination pageCount={15} currentPage={2} onPageChange={e => e.preventDefault()} showPages={{narrow: false}} /> | ||
) |