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

feat(toHaveValue): Asserting aria-valuenow #479

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

idanen
Copy link

@idanen idanen commented Sep 20, 2022

Resolves #478

What:

Change .toHaveValue() to support aria-valuenow

Why:

How:

Checklist:

  • Documentation
  • Tests
  • Updated Type Definitions
  • Ready to be merged

src/utils.js Outdated
return element.value
default: {
const accessibleValue = getAccessibleValue(element)
return element.value ?? accessibleValue

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@idanen Which should have precedence, value or aria-valuenow? At the moment it looks like the former has precedence.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

value should take precedence.
That's how Chrome's accessibility tab behaves

src/utils.js Outdated Show resolved Hide resolved
Co-authored-by: Wayne Van Son <waynevanson@gmail.com>
@idanen
Copy link
Author

idanen commented Sep 23, 2022

@gnapse @nickmccurdy any chance one of you can help push this forward?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make .toHaveValue() check value of aria-valuenow as a fallback to value
2 participants