-
Notifications
You must be signed in to change notification settings - Fork 841
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
[htmlIdGenerator] testenv mock #4212
Conversation
Just to make sure, I noticed that in the a11y test where we need the unique IDs, you call |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4212/ |
Thanks for bringing this up. Testing in Kibana highlights that I have a solution in mind: add a second parameter on the testenv version that calls As in:
|
As that requires re-mocking the generator anyway, might be cleaner to let the mock do its own thing instead of building that extra support into the shipped mock? |
I'm good with this approach, also. What do you think, @myasonik? |
Seems good to me! |
Because we're in agreement on not adding more to the mock, this is ready for review. |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4212/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM!
Preview documentation changes for this PR: https://eui.elastic.co/pr_4212/ |
Summary
Closes #1381 by providing a
testenv
mock for use in Jest environments (makeId
was previously removed and not in use).Added internal mocking to EUI and removed one-off component mocks from individual test files.
Explored this idea, but without line numbers the trace is not very helpful, and with numbers we run the risk of excessive snapshot churn. We can discuss here if something other than
generated-id
is better.Checklist
- [ ] Check against all themes for compatibility in both light and dark modes- [ ] Checked in mobile- [ ] Checked in Chrome, Safari, Edge, and Firefox- [ ] Props have proper autodocs- [ ] Added documentation- [ ] Checked Code Sandbox works for the any docs examples- [ ] Checked for breaking changes and labeled appropriately- [ ] Checked for accessibility including keyboard-only and screenreader modes