Accessibility · Senior · Question 65 of 75

Which test assertion checks what a user of assistive tech gets?

Show the answer

Correct answer: expect(button).toHaveAccessibleName("Save")

Explanation

jest-dom computes names and descriptions as the browser would. Attribute checks test implementation details instead.

Further reading

Problem with a question

Accessibility · Senior · question 65

Test yourself

Take the Accessibility · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz