Skip to content

Commit 4689b35

Browse files
committed
test: setup accessibility tests with axe
1 parent d9b8bfd commit 4689b35

File tree

5 files changed

+81
-0
lines changed

5 files changed

+81
-0
lines changed

package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"@rollup/plugin-node-resolve": "^15.0.1",
7070
"@rollup/plugin-replace": "^5.0.2",
7171
"@rollup/plugin-terser": "^0.4.0",
72+
"axe-core": "^4.9.0",
7273
"babel-loader": "^9.1.0",
7374
"babel-plugin-istanbul": "^6.1.1",
7475
"bio-dts": "^0.11.0",

test/spec/ModelerSpec.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import axe from 'axe-core';
2+
13
import Modeler from 'lib/Modeler';
24
import Viewer from 'lib/Viewer';
35
import NavigatedViewer from 'lib/NavigatedViewer';
@@ -973,6 +975,25 @@ describe('Modeler', function() {
973975
expect(Modeler.NavigatedViewer).to.equal(NavigatedViewer);
974976
});
975977

978+
979+
describe('accessibility', function() {
980+
981+
it('should report no issues', async function() {
982+
983+
// given
984+
const xml = require('../fixtures/bpmn/simple.bpmn');
985+
await createModeler(xml);
986+
987+
// when
988+
const results = await axe.run(container);
989+
990+
// then
991+
expect(results.passes).to.be.not.empty;
992+
expect(results.violations).to.be.empty;
993+
});
994+
995+
});
996+
976997
});
977998

978999

test/spec/NavigatedViewerSpec.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import axe from 'axe-core';
2+
13
import NavigatedViewer from 'lib/NavigatedViewer';
24

35
import EditorActionsModule from 'lib/features/editor-actions';
@@ -99,4 +101,24 @@ describe('NavigatedViewer', function() {
99101
});
100102
});
101103
});
104+
105+
106+
describe('accessibility', function() {
107+
108+
it('should report no issues', async function() {
109+
110+
// given
111+
const xml = require('../fixtures/bpmn/simple.bpmn');
112+
await createViewer(container, NavigatedViewer, xml);
113+
114+
// when
115+
const results = await axe.run(container);
116+
117+
// then
118+
expect(results.passes).to.be.not.empty;
119+
expect(results.violations).to.be.empty;
120+
});
121+
122+
});
123+
102124
});

test/spec/ViewerSpec.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import axe from 'axe-core';
2+
13
import TestContainer from 'mocha-test-container-support';
24

35
import Diagram from 'diagram-js/lib/Diagram';
@@ -1795,4 +1797,23 @@ describe('Viewer', function() {
17951797
expect(ViewerDefaultExport).to.equal(Viewer);
17961798
});
17971799

1800+
1801+
describe('accessibility', function() {
1802+
1803+
it('should report no issues', async function() {
1804+
1805+
// given
1806+
const xml = require('../fixtures/bpmn/simple.bpmn');
1807+
await createViewer(container, Viewer, xml);
1808+
1809+
// when
1810+
const results = await axe.run(container);
1811+
1812+
// then
1813+
expect(results.passes).to.be.not.empty;
1814+
expect(results.violations).to.be.empty;
1815+
});
1816+
1817+
});
1818+
17981819
});

0 commit comments

Comments
 (0)