Skip to content

Commit d822774

Browse files
committed
test: Current behavior for accessible roles
1 parent 9d62141 commit d822774

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/__tests__/role.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,34 @@ Here are the accessible roles:
321321
`)
322322
})
323323

324+
test('does not include the container in the queryable roles', () => {
325+
const {getByRole} = render(`<li />`, {
326+
container: document.createElement('ul'),
327+
})
328+
expect(() => getByRole('list')).toThrowErrorMatchingInlineSnapshot(`
329+
"Unable to find an accessible element with the role "list"
330+
331+
Here are the accessible roles:
332+
333+
list:
334+
335+
Name "":
336+
<ul />
337+
338+
--------------------------------------------------
339+
listitem:
340+
341+
Name "":
342+
<li />
343+
344+
--------------------------------------------------
345+
346+
<ul>
347+
<li />
348+
</ul>"
349+
`)
350+
})
351+
324352
describe('configuration', () => {
325353
let originalConfig
326354
beforeEach(() => {

0 commit comments

Comments
 (0)