The Call Kent Podcast

Tests for accessible error messages


Listen Later

Hi Kent!

My name is Jan. I'd like to ask you: How do you write tests for accessible error messages with testing library?

By accessible error messages, I mean, suppose you have a form with an input. You have a p tag which renders the error, if there is an error. And that p tag has an id.

And now you pass this p tags id to the input as a value for the aria-describedby property.

So far, I'm using byText to check for the existence of that error in my tests, but I was wondering whether there is a better query for that?

Thank you!

  • Custom Queries

 Tests for accessible error messages

...more
View all episodesView all episodes
Download on the App Store

The Call Kent PodcastBy Kent C. Dodds

  • 5
  • 5
  • 5
  • 5
  • 5

5

2 ratings


More shows like The Call Kent Podcast

View all
The Changelog: Software Development, Open Source by Changelog Media

The Changelog: Software Development, Open Source

288 Listeners

Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

Syntax - Tasty Web Development Treats

990 Listeners

PodRocket by LogRocket

PodRocket

61 Listeners