Skip to content

Commit 4a6b595

Browse files
test: add coverage for footer to confirm it's expected implicit role as contentinfo
1 parent 8eab139 commit 4a6b595

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/__tests__/role-helpers.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ function setup() {
6868
<img alt="" src="http://example.com/image.png" data-testid='a-img-2'/>
6969
<img alt="a meaningful description" src="http://example.com/image.png" data-testid='a-img-3'/>
7070
</section>
71+
<footer data-testid="a-footer">Contentinfo footer</footer>
7172
`)
7273

7374
return {
@@ -105,6 +106,7 @@ function setup() {
105106
unnamedImg: getByTestId('a-img-1'),
106107
presentationImg: getByTestId('a-img-2'),
107108
namedImg: getByTestId('a-img-3'),
109+
footer: getByTestId('a-footer'),
108110
}
109111
}
110112

@@ -143,6 +145,7 @@ test('getRoles returns expected roles for various dom nodes', () => {
143145
unnamedImg,
144146
presentationImg,
145147
namedImg,
148+
footer,
146149
} = setup()
147150

148151
expect(getRoles(namedSection)).toEqual({
@@ -169,6 +172,9 @@ test('getRoles returns expected roles for various dom nodes', () => {
169172
expect(getRoles(header)).toEqual({
170173
banner: [header],
171174
})
175+
expect(getRoles(footer)).toEqual({
176+
contentinfo: [footer],
177+
})
172178
})
173179

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

0 commit comments

Comments
 (0)