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

Merged
merged 5 commits into from
Aug 23, 2024

Conversation

idanen
Copy link
Contributor

@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
Copy link
Contributor

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
Contributor 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
@idanen
Copy link
Contributor Author

idanen commented Sep 23, 2022

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

Copy link
Member

@gnapse gnapse left a comment

Choose a reason for hiding this comment

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

Only one comment that I think needs to be addressed before merging this.

src/utils.js Outdated Show resolved Hide resolved
@gnapse gnapse enabled auto-merge (squash) August 6, 2024 12:54
auto-merge was automatically disabled August 18, 2024 09:36

Head branch was pushed to by a user without write access

@idanen
Copy link
Contributor Author

idanen commented Aug 19, 2024

@gnapse finally fixed the coverage. Can you please give it another look?

@idanen idanen requested a review from gnapse August 22, 2024 06:53
@gnapse gnapse merged commit acbf416 into testing-library:main Aug 23, 2024
5 checks passed
@gnapse
Copy link
Member

gnapse commented Aug 23, 2024

@all-contributors please add @idanen for code, test

Copy link
Contributor

@gnapse

I've put up a pull request to add @idanen! 🎉

@gnapse
Copy link
Member

gnapse commented Aug 23, 2024

@all-contributors please add @waynevanson for code, test

Copy link
Contributor

@gnapse

I've put up a pull request to add @waynevanson! 🎉

@gnapse
Copy link
Member

gnapse commented Aug 23, 2024

@all-contributors please add @waynevanson for code, test

Copy link
Contributor

@gnapse

@waynevanson already contributed before to code, test

Copy link

🎉 This PR is included in version 6.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
4 participants