Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hasDescription assertion that works with aria-describedby #794

Open
EvgenyOrekhov opened this issue Aug 25, 2020 · 0 comments
Open

Add hasDescription assertion that works with aria-describedby #794

EvgenyOrekhov opened this issue Aug 25, 2020 · 0 comments

Comments

@EvgenyOrekhov
Copy link

Similar to https://github.com/testing-library/jest-dom#tohavedescription.

I'm trying to use Testing Library with QUnit, and I think hasDescription() would fit really nice.

Example:

<label for="email">Email</label>
<input
  id="email"
  type="email"
  aria-describedby="emailMessage"
/>
<small id="emailMessage">Email is invalid</small>
assert.dom(getByLabelText("Email")).hasDescription("Email is invalid");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants