diff --git a/package-lock.json b/package-lock.json index 57fbf4e7cbb1..067f7dae686d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -107,7 +107,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", @@ -23395,43 +23395,18 @@ } }, "node_modules/jest-axe": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/jest-axe/-/jest-axe-6.0.0.tgz", - "integrity": "sha512-gAh/2zoWii4Rbhe6IUIo5TTiseGJDCitFnDFwBNpIuaOciyQgVZue6jtd4W7oMoKHewKoRSuIol7t/MuGx+mqg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/jest-axe/-/jest-axe-8.0.0.tgz", + "integrity": "sha512-4kNcNn7J0jPO4jANEYZOHeQ/tSBvkXS+MxTbX1CKbXGd0+ZbRGDn/v/8IYWI/MmYX15iLVyYRnRev9X3ksePWA==", "dev": true, "dependencies": { - "axe-core": "4.4.1", - "chalk": "4.1.0", - "jest-matcher-utils": "27.0.2", + "axe-core": "4.7.2", + "chalk": "4.1.2", + "jest-matcher-utils": "29.2.2", "lodash.merge": "4.6.2" }, "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/jest-axe/node_modules/@jest/types": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", - "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^16.0.0", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, - "node_modules/jest-axe/node_modules/@types/yargs": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.3.tgz", - "integrity": "sha512-YlFfTGS+zqCgXuXNV26rOIeETOkXnGQXP/pjjL9P0gO/EP9jTmc7pUBhx+jVEIxpq41RX33GQ7N3DzOSfZoglQ==", - "dev": true, - "dependencies": { - "@types/yargs-parser": "*" + "node": ">= 14.0.0" } }, "node_modules/jest-axe/node_modules/ansi-styles": { @@ -23449,10 +23424,19 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/jest-axe/node_modules/axe-core": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.7.2.tgz", + "integrity": "sha512-zIURGIS1E1Q4pcrMjp+nnEh+16G56eG/MUllJH8yEvw7asDo7Ac9uhC9KIH5jzpITueEZolfYglnCGIuSBz39g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/jest-axe/node_modules/chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -23483,15 +23467,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/jest-axe/node_modules/diff-sequences": { - "version": "27.0.1", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.0.1.tgz", - "integrity": "sha512-XPLijkfJUh/PIBnfkcSHgvD6tlYixmcMAn3osTk6jt+H0v/mgURto1XUiD9DKuGX5NDoVS6dSlA23gd9FUaCFg==", - "dev": true, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, "node_modules/jest-axe/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -23501,70 +23476,19 @@ "node": ">=8" } }, - "node_modules/jest-axe/node_modules/jest-diff": { - "version": "27.0.2", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.0.2.tgz", - "integrity": "sha512-BFIdRb0LqfV1hBt8crQmw6gGQHVDhM87SpMIZ45FPYKReZYG5er1+5pIn2zKqvrJp6WNox0ylR8571Iwk2Dmgw==", - "dev": true, - "dependencies": { - "chalk": "^4.0.0", - "diff-sequences": "^27.0.1", - "jest-get-type": "^27.0.1", - "pretty-format": "^27.0.2" - }, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, - "node_modules/jest-axe/node_modules/jest-get-type": { - "version": "27.0.1", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.0.1.tgz", - "integrity": "sha512-9Tggo9zZbu0sHKebiAijyt1NM77Z0uO4tuWOxUCujAiSeXv30Vb5D4xVF4UR4YWNapcftj+PbByU54lKD7/xMg==", - "dev": true, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, "node_modules/jest-axe/node_modules/jest-matcher-utils": { - "version": "27.0.2", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.0.2.tgz", - "integrity": "sha512-Qczi5xnTNjkhcIB0Yy75Txt+Ez51xdhOxsukN7awzq2auZQGPHcQrJ623PZj0ECDEMOk2soxWx05EXdXGd1CbA==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.2.2.tgz", + "integrity": "sha512-4DkJ1sDPT+UX2MR7Y3od6KtvRi9Im1ZGLGgdLFLm4lPexbTaCgJW5NN3IOXlQHF7NSHY/VHhflQ+WoKtD/vyCw==", "dev": true, "dependencies": { "chalk": "^4.0.0", - "jest-diff": "^27.0.2", - "jest-get-type": "^27.0.1", - "pretty-format": "^27.0.2" - }, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, - "node_modules/jest-axe/node_modules/pretty-format": { - "version": "27.0.2", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.0.2.tgz", - "integrity": "sha512-mXKbbBPnYTG7Yra9qFBtqj+IXcsvxsvOBco3QHxtxTl+hHKq6QdzMZ+q0CtL4ORHZgwGImRr2XZUX2EWzORxig==", - "dev": true, - "dependencies": { - "@jest/types": "^27.0.2", - "ansi-regex": "^5.0.0", - "ansi-styles": "^5.0.0", - "react-is": "^17.0.1" + "jest-diff": "^29.2.1", + "jest-get-type": "^29.2.0", + "pretty-format": "^29.2.1" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, - "node_modules/jest-axe/node_modules/pretty-format/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-axe/node_modules/supports-color": { @@ -41330,7 +41254,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", diff --git a/package.json b/package.json index 4eaa0f31215f..2d09e58a401e 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/packages/story-editor/package.json b/packages/story-editor/package.json index 22ab9f26a27e..ef9f28513afb 100644 --- a/packages/story-editor/package.json +++ b/packages/story-editor/package.json @@ -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", diff --git a/packages/story-editor/src/components/library/test/mediaElement.js b/packages/story-editor/src/components/library/test/mediaElement.js index 2e49138d25ed..c598578876c3 100644 --- a/packages/story-editor/src/components/library/test/mediaElement.js +++ b/packages/story-editor/src/components/library/test/mediaElement.js @@ -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({