Skip to content

Commit 29d9b47

Browse files
committed
simplify some tests
1 parent 8e0ad83 commit 29d9b47

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/__tests__/role.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,7 @@ test('can be filtered by accessible name', () => {
214214
expect(deliveryForm).not.toBeNull()
215215

216216
expect(
217-
// TODO: upstream bug in `aria-query`; should be `button` role
218-
getQueriesForElement(deliveryForm).getByRole('textbox', {name: 'Submit'}),
217+
getQueriesForElement(deliveryForm).getByRole('button', {name: 'Submit'}),
219218
).not.toBeNull()
220219

221220
const invoiceForm = getByRole('form', {name: 'Delivery Adress'})
@@ -229,11 +228,9 @@ test('can be filtered by accessible name', () => {
229228
test('accessible name comparison is case sensitive', () => {
230229
const {getByRole} = render(`<h1>Sign <em>up</em></h1>`)
231230

232-
// actual: "Sign up",
233-
// queried: "Sign Up"
234-
expect(() => getByRole('heading', {name: 'Sign Up'}))
231+
expect(() => getByRole('heading', {name: 'something that does not match'}))
235232
.toThrowErrorMatchingInlineSnapshot(`
236-
"Unable to find an accessible element with the role "heading" and name "Sign Up"
233+
"Unable to find an accessible element with the role "heading" and name "something that does not match"
237234
238235
Here are the accessible roles:
239236
@@ -277,9 +274,9 @@ test('accessible name filter implements TextMatch', () => {
277274
test('TextMatch serialization in error message', () => {
278275
const {getByRole} = render(`<h1>Sign <em>up</em></h1>`)
279276

280-
expect(() => getByRole('heading', {name: /Login/}))
277+
expect(() => getByRole('heading', {name: /something that does not match/}))
281278
.toThrowErrorMatchingInlineSnapshot(`
282-
"Unable to find an accessible element with the role "heading" and name \`/Login/\`
279+
"Unable to find an accessible element with the role "heading" and name \`/something that does not match/\`
283280
284281
Here are the accessible roles:
285282

0 commit comments

Comments
 (0)