Skip to content

Commit c6e1bb9

Browse files
committed
fix: Treat header as banner role
The latest [aria-query version](https://github.com/A11yance/aria-query/releases/tag/v4.2.2) fixes the issue of failing to recognize `<header>` as a `banner` role. Fixes: #578
1 parent 55344ea commit c6e1bb9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
],
4040
"dependencies": {
4141
"@babel/runtime": "^7.10.2",
42-
"aria-query": "^4.0.2",
42+
"aria-query": "^4.2.1",
4343
"dom-accessibility-api": "^0.4.5",
4444
"pretty-format": "^25.5.0"
4545
},

src/__tests__/queries.find.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ test('find asynchronously finds elements', async () => {
3434
<span title="test title" />
3535
<div role="dialog"></div>
3636
<div role="meter progressbar"></div>
37+
<header>header</header>
3738
</div>
3839
`)
3940
await expect(findByLabelText('test-label')).resolves.toBeTruthy()
@@ -66,6 +67,9 @@ test('find asynchronously finds elements', async () => {
6667
findAllByRole('progressbar', {queryFallbacks: true}),
6768
).resolves.toHaveLength(1)
6869

70+
await expect(findByRole('banner')).resolves.toBeTruthy()
71+
await expect(findAllByRole('banner')).resolves.toHaveLength(1)
72+
6973
await expect(findByTestId('test-id')).resolves.toBeTruthy()
7074
await expect(findAllByTestId('test-id')).resolves.toHaveLength(1)
7175
})

0 commit comments

Comments
 (0)