Skip to content

Commit

Permalink
fix: added image role separator tests, Fixes #405
Browse files Browse the repository at this point in the history
  • Loading branch information
danielweck committed Feb 4, 2025
1 parent 438d9ca commit 52c78de
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/__tests__/axe-rules.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,34 @@ test('DPUB ARIA roles are allowed', async () => {
}),
}),
]));

expect(assertions).not.toEqual(expect.arrayContaining([
expect.objectContaining({
'earl:test': expect.objectContaining({ 'dct:title': 'aria-allowed-role', 'earl:impact': 'minor', }),
'earl:result': expect.objectContaining({
'earl:outcome': 'fail',
'earl:pointer': expect.objectContaining({ css: ['#separator1'] }),
}),
}),
]));
expect(assertions).toEqual(expect.arrayContaining([
expect.objectContaining({
'earl:test': expect.objectContaining({ 'dct:title': 'aria-allowed-role', 'earl:impact': 'minor', }),
'earl:result': expect.objectContaining({
'earl:outcome': 'fail',
'earl:pointer': expect.objectContaining({ css: ['#separator3'] }),
}),
}),
]));
expect(assertions).toEqual(expect.arrayContaining([
expect.objectContaining({
'earl:test': expect.objectContaining({ 'dct:title': 'aria-allowed-role', 'earl:impact': 'minor', }),
'earl:result': expect.objectContaining({
'earl:outcome': 'fail',
'earl:pointer': expect.objectContaining({ css: ['#separator2'] }),
}),
}),
]));
});
test('DPUB ARIA roles are allowed (with epub:type deprecated)', async () => {
const report = await ace('../data/axerule-dpubroles-matching');
Expand Down
3 changes: 3 additions & 0 deletions tests/data/axerule-dpubroles-matching/EPUB/content_001.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
<div role="doc-colophon"></div>
<div role="doc-conclusion"></div>
<img role="doc-cover" src="image_001.jpg" alt="A beautiful cover"/>
<img id="separator1" role="separator" src="image_sep.jpg" alt="separatoralt"/>
<!-- img id="separator2" role="separator" src="image_sep.jpg" alt=""/>
<img id="separator3" role="separator" src="image_sep.jpg"/ -->
<div role="doc-credit"></div>
<div role="doc-credits"></div>
<div role="doc-dedication"></div>
Expand Down
3 changes: 3 additions & 0 deletions tests/data/axerule-dpubroles/EPUB/content_001.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
<div role="doc-colophon"></div>
<div role="doc-conclusion"></div>
<img role="doc-cover" src="image_001.jpg" alt="A beautiful cover"/>
<img id="separator1" role="separator" src="image_sep.jpg" alt="separatoralt"/>
<img id="separator2" role="separator" src="image_sep.jpg" alt=""/>
<img id="separator3" role="separator" src="image_sep.jpg"/>
<div role="doc-credit"></div>
<div role="doc-credits"></div>
<div role="doc-dedication"></div>
Expand Down

0 comments on commit 52c78de

Please sign in to comment.