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: add withAriaSupport option #1194

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

buschtoens
Copy link

As suggested in #915 (comment), this PR adds a withAriaSupport option, so that aria-* options are considered.

If not explicitly set, it defaults to false for all assertions, except for isChecked / isNotChecked, where it defaults to true. This way this is a non-breaking change.

isRequired(message?: string): DOMAssertions {
isRequired.call(this, message);
isRequired(message?: string, options?: { withAriaSupport?: boolean }): DOMAssertions {
isRequired.call(this, message, options);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is missing the fallback to this.options.withAriaSupport if the option is not explicitly specified in the passed in options argument

Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm, looks like you've moved that fallback into the functions. I think I'd prefer it if the functions would always get an options object with a withAriaSupport value and don't have to depend on this except for this.pushResult(). 🤔

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.

None yet

2 participants