Accessibility tests questions answered

3 minutes read

After I wrote yesterday's email, I immediately realised I might have left you with some questions. I'll answer some inline below.

How do you tell the difference between good accessibility tests and bad ones?

Good accessibility tests try to simulate real user behaviour and validate outcomes. Bad ones will just check the presence of some attributes and not their content. A good test verifies that the label is meaningful and describes what the button actually does by "thinking" like a user. Look for tests that answer "can a user do what they need to do?" rather than "does this element have the required properties?"

What should you do when fixing accessibility issues breaks your existing tests?

See it as a learning opportunity and update your tests to reflect the reality. Those failing tests were giving you false confidence about broken functionality anyway. You might as well update them to test the new, accessible behavior rather than the old broken patterns.

What are some specific examples of good accessibility tests?

Good tests simulate user interactions. They test a user can navigate a form using only the tab key. They test they can submit an invalid form, get an error message announced by screen readers and clearly associated with the problematic field.

Without getting into the details of unit tests vs integration tests vs end-to-end tests, here's a real example of a simple test I have on my own website that checks if a user can sign up to my daily list.

How can you convince your manager that failing tests after accessibility improvements are actually a good thing?

I'd frame it as technical debt discovery rather than regression. If you can explain that these tests were masking real user problems that existed all along, then it makes it easier to push through. After all, you're not breaking working functionality, you're just revealing that it was never working for everyone. The goal is to show your manager that fixing these "new" test failures prevents actual user frustration.

What's wrong with alt text that says "decorative image" and how do you write better alt text?

I go over this in more detail on my free Six Days to an Accessible Website email course. The short of it is that alt text labeled "decorative image" defeats the entire purpose. If an image is decorative, you don't want a screen reader to announce it at all. To that end, a decorative image should have empty alt text (alt="") so screen readers skip it entirely. If you label it "decorative image," you're forcing users to hear irrelevant information that clutters their experience.

Good alt text either describes the image's content when relevant to the context or is empty when the image adds no meaningful information. The key is understanding the image's purpose in context, not just its visual content.

Sent on

Did you enjoy this bite-sized message?

I send out short emails like this every day to help you gain a fresh perspective on accessibility and understand it without the jargon, so you can build more robust products that everyone can use, including people with disabilities.

You can unsubscribe in one click and I will never share your email address.