Skip to content

Commit

Permalink
Bump jest-axe from 6.0.0 to 8.0.0 (#13466)
Browse files Browse the repository at this point in the history
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Birchler <[email protected]>
  • Loading branch information
dependabot[bot] and swissspidy authored Oct 2, 2023
1 parent 939fb86 commit 83a151e
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 124 deletions.
132 changes: 28 additions & 104 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"html-webpack-plugin": "^5.5.3",
"husky": "^8.0.3",
"jest": "^29.6.1",
"jest-axe": "^6.0.0",
"jest-axe": "^8.0.0",
"jest-canvas-mock": "^2.5.2",
"jest-environment-jsdom": "^29.6.1",
"jest-extended": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/story-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.5.1",
"jest": "^29.6.1",
"jest-axe": "^6.0.0",
"jest-axe": "^8.0.0",
"jest-matcher-deep-close-to": "^3.0.2",
"libheif-js": "^1.15.1",
"mockdate": "^3.0.5",
Expand Down
51 changes: 33 additions & 18 deletions packages/story-editor/src/components/library/test/mediaElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,24 +118,39 @@ describe('MediaElement', () => {
beforeEach(() => {
useLocalMedia.mockReturnValue(mockedReturnValue);
});
it.each`
type | resource
${'image'} | ${IMAGE_RESOURCE}
${'video'} | ${VIDEO_RESOURCE}
${'gif'} | ${GIF_RESOURCE}
`(
'should render MediaElement for a resource of type=`$type` without accessibility violations',
async ({ resource }) => {
useLocalMedia.mockReturnValue({
...mockedReturnValue,
canTranscodeResource: () => true,
});
const { container } = renderMediaElement(resource, 'local');

const results = await axe(container);
expect(results).toHaveNoViolations();
}
);

it('should render MediaElement for a resource of type=`image` without accessibility violations', async () => {
useLocalMedia.mockReturnValue({
...mockedReturnValue,
canTranscodeResource: () => true,
});
const { container } = renderMediaElement(IMAGE_RESOURCE, 'local');

const results = await axe(container);
expect(results).toHaveNoViolations();
}, 30000);

it('should render MediaElement for a resource of type=`gif` without accessibility violations', async () => {
useLocalMedia.mockReturnValue({
...mockedReturnValue,
canTranscodeResource: () => true,
});
const { container } = renderMediaElement(GIF_RESOURCE, 'local');

const results = await axe(container);
expect(results).toHaveNoViolations();
}, 30000);

it('should render MediaElement for a resource of type=`video` without accessibility violations', async () => {
useLocalMedia.mockReturnValue({
...mockedReturnValue,
canTranscodeResource: () => true,
});
const { container } = renderMediaElement(VIDEO_RESOURCE, 'local');

const results = await axe(container);
expect(results).toHaveNoViolations();
}, 30000);

it("should render dropdown menu's more icon for uploaded image", () => {
useLocalMedia.mockReturnValue({
Expand Down

0 comments on commit 83a151e

Please sign in to comment.