-
Notifications
You must be signed in to change notification settings - Fork 53
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
Make helpers configurable in setupGlobalA11yHooks
mode
#319
Conversation
This allows ember-a11y-testing to automatically perform an audit when the `render` helper is used, thereby improving automated coverage for component tests. We’ve added in a test component test to ensure this is plumbed-in correctly. Note the comment about the surprising additional audit in this context. Co-authored-by: Melanie Sumner <[email protected]>
1f47fc9
to
0072099
Compare
This would be a breaking change IMO, in that we'd be introducing a new point for a test to fail where one didn't exist before. There are also perf considerations, in that the total volume of a11y audits would substantially increase. I'm wondering if instead we could make this an opt-in setting, or expose an API to make global hook registration configurable, as this project isn't quite ready for a v5 release. I'm curious to get @scalvert's take, as he authored the hooks implementation, and I'm sure there was a good reason why we didn't leverage |
@drewlee I think even if we consider this a breaking change AND decide that it should be an option, the option should be to turn it off (having it on should be the default state). WDYT? |
I really like this idea for a few reasons:
I also like what you suggested, @MelSumner, WRT to making this an option. What if we, in fact, made all of the hook bindings optional, with specific defaults. This would allow us to add this change, keep the current set of defaults, and give folks a path to using Thoughts? |
tests/integration/components/setup-global-a11y-hooks-test-test.ts
Outdated
Show resolved
Hide resolved
tests/integration/components/setup-global-a11y-hooks-test-test.ts
Outdated
Show resolved
Hide resolved
tests/integration/components/setup-global-a11y-hooks-test-test.ts
Outdated
Show resolved
Hide resolved
Thanks for the splendid feedback and ideas y'all. I'll continue working on it this week. |
Co-authored-by: Greg Hoin <[email protected]>
Co-authored-by: Greg Hoin <[email protected]>
Co-authored-by: Greg Hoin <[email protected]>
Co-authored-by: Greg Hoin <[email protected]>
@gregone and I addressed all the feedback and added the new configuration option in the most pragmatic way possible. Looking forward to hearing what y’all think. |
setupGlobalA11yHooks
mode
setupGlobalA11yHooks
modesetupGlobalA11yHooks
mode
Co-authored-by: Steve Calvert <[email protected]>
@scalvert I went back to the original implementation in the end, as it wasn’t an issue of variable redeclaration. I think this solution is pretty clear (or as clear as overloaded function signatures can ever be).
This adds an additional argument,
options
, tosetupGlobalA11yHooks
which allows us to specify additional helpers to hook into.The motivating use case is to automatically perform an audit when the
render
helper is used, thereby improving automated coverage for component tests.