Skip to content

Commit

Permalink
test: add coverage for footer to confirm it's expected implicit role …
Browse files Browse the repository at this point in the history
…as contentinfo
  • Loading branch information
jlp-craigmorten committed Sep 10, 2023
1 parent 8eab139 commit 4a6b595
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/__tests__/role-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ function setup() {
<img alt="" src="http://example.com/image.png" data-testid='a-img-2'/>
<img alt="a meaningful description" src="http://example.com/image.png" data-testid='a-img-3'/>
</section>
<footer data-testid="a-footer">Contentinfo footer</footer>
`)

return {
Expand Down Expand Up @@ -105,6 +106,7 @@ function setup() {
unnamedImg: getByTestId('a-img-1'),
presentationImg: getByTestId('a-img-2'),
namedImg: getByTestId('a-img-3'),
footer: getByTestId('a-footer'),
}
}

Expand Down Expand Up @@ -143,6 +145,7 @@ test('getRoles returns expected roles for various dom nodes', () => {
unnamedImg,
presentationImg,
namedImg,
footer,
} = setup()

expect(getRoles(namedSection)).toEqual({
Expand All @@ -169,6 +172,9 @@ test('getRoles returns expected roles for various dom nodes', () => {
expect(getRoles(header)).toEqual({
banner: [header],
})
expect(getRoles(footer)).toEqual({
contentinfo: [footer],
})
})

test('logRoles calls console.log with output from prettyRoles', () => {
Expand Down

0 comments on commit 4a6b595

Please sign in to comment.