From 774daa50feae7198b333c613b4a43b77d24bb219 Mon Sep 17 00:00:00 2001 From: Maciej Barelkowski Date: Fri, 21 Jun 2024 14:24:18 +0200 Subject: [PATCH] fix: remove incorrect attribute in popup menu item Related https://github.com/camunda/camunda-modeler/issues/4383 --- lib/features/popup-menu/PopupMenuItem.js | 1 - package-lock.json | 39 +++++++++++++++++++ package.json | 1 + .../popup-menu/PopupMenuComponentSpec.js | 12 ++++++ 4 files changed, 52 insertions(+), 1 deletion(-) diff --git a/lib/features/popup-menu/PopupMenuItem.js b/lib/features/popup-menu/PopupMenuItem.js index 4ffd4dc85..332f4a5e3 100644 --- a/lib/features/popup-menu/PopupMenuItem.js +++ b/lib/features/popup-menu/PopupMenuItem.js @@ -40,7 +40,6 @@ export default function PopupMenuItem(props) { onMouseEnter=${ onMouseEnter } onMouseLeave=${ onMouseLeave } onDragStart=${ (event) => onAction(event, entry, 'dragstart') } - aria-role="button" draggable=${ true } >
diff --git a/package-lock.json b/package-lock.json index e09e51d3a..c0f8d57b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ }, "devDependencies": { "@babel/core": "^7.23.9", + "@bpmn-io/a11y": "^0.1.0", "@testing-library/preact": "^3.2.3", "babel-loader": "^9.1.3", "babel-plugin-istanbul": "^6.1.1", @@ -415,6 +416,19 @@ "node": ">=6.9.0" } }, + "node_modules/@bpmn-io/a11y": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@bpmn-io/a11y/-/a11y-0.1.0.tgz", + "integrity": "sha512-pEQGGZQchACYRblv+ubA3QXUOSMR+CMSRkabErI06T5MGHcnUQ3WULUaOM/ieF3imMIR6Hz7MPOuwCfrAaNqJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "axe-core": "^4.9.1" + }, + "peerDependencies": { + "chai": "*" + } + }, "node_modules/@bpmn-io/diagram-js-ui": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bpmn-io/diagram-js-ui/-/diagram-js-ui-0.2.3.tgz", @@ -1530,6 +1544,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/axe-core": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.9.1.tgz", + "integrity": "sha512-QbUdXJVTpvUTHU7871ppZkdOLBeGUKBQWHkHrvN2V9IQWGMt61zf3B45BtzjxEJzYuj0JBjBZP/hmYS/R9pmAw==", + "dev": true, + "license": "MPL-2.0", + "engines": { + "node": ">=4" + } + }, "node_modules/b4a": { "version": "1.6.6", "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.6.tgz", @@ -8806,6 +8830,15 @@ "to-fast-properties": "^2.0.0" } }, + "@bpmn-io/a11y": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@bpmn-io/a11y/-/a11y-0.1.0.tgz", + "integrity": "sha512-pEQGGZQchACYRblv+ubA3QXUOSMR+CMSRkabErI06T5MGHcnUQ3WULUaOM/ieF3imMIR6Hz7MPOuwCfrAaNqJw==", + "dev": true, + "requires": { + "axe-core": "^4.9.1" + } + }, "@bpmn-io/diagram-js-ui": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bpmn-io/diagram-js-ui/-/diagram-js-ui-0.2.3.tgz", @@ -9689,6 +9722,12 @@ "possible-typed-array-names": "^1.0.0" } }, + "axe-core": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.9.1.tgz", + "integrity": "sha512-QbUdXJVTpvUTHU7871ppZkdOLBeGUKBQWHkHrvN2V9IQWGMt61zf3B45BtzjxEJzYuj0JBjBZP/hmYS/R9pmAw==", + "dev": true + }, "b4a": { "version": "1.6.6", "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.6.tgz", diff --git a/package.json b/package.json index 6fa0c4c43..6ec57af2c 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ ], "devDependencies": { "@babel/core": "^7.23.9", + "@bpmn-io/a11y": "^0.1.0", "@testing-library/preact": "^3.2.3", "babel-loader": "^9.1.3", "babel-plugin-istanbul": "^6.1.1", diff --git a/test/spec/features/popup-menu/PopupMenuComponentSpec.js b/test/spec/features/popup-menu/PopupMenuComponentSpec.js index 6ce440fea..526d7e3c9 100644 --- a/test/spec/features/popup-menu/PopupMenuComponentSpec.js +++ b/test/spec/features/popup-menu/PopupMenuComponentSpec.js @@ -1,3 +1,5 @@ +import { expectToBeAccessible } from '@bpmn-io/a11y'; + import PopupMenuComponent from 'lib/features/popup-menu/PopupMenuComponent'; import { @@ -713,6 +715,16 @@ describe('features/popup-menu - ', function() { // then expect(searchInput.getAttribute('aria-label')).to.eql('Search'); }); + + + it('should report no violations', async function() { + + // given + await createPopupMenu({ container, entries, title: 'Search', search: true }); + + // then + await expectToBeAccessible(container); + }); });