-
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
[EuiBasicTable] "Select all" checkbox regenerates id on each render #3111
Comments
@tsullivan It will only auto-generate if you don't pass an
And then the id of the box is |
The same |
The generated id occurs in the "Select all" ( For unit testing, mocking is the correct approach: But any interaction in the table will cause the id to be changed. It should be stored in local state for the duration of the component lifecycle. |
EuiInMemoryTable
/EuiBasicTable
"Select all" checkbox regenerates id on each render
@thompsongl make/generate id functions might be good candidates for our jest build. May also be too judicial of a choice... maybe the mocked function can expose some configuration method? |
@chandlerprall Yes, especially after we get #3112 done and it's clear where the id is coming from.
Everything seems relatively safe after icons 😄. Customization is a good idea, though |
EuiInMemoryTable
/EuiBasicTable
"Select all" checkbox regenerates id on each render
It looks like the checkbox IDs are populated by making dynamic strings. This is making it impossible to do unit testing with snapshots.
Example of the dynamic strings, from the EUI docs:
Snapshot tests will fail with errors like:
The text was updated successfully, but these errors were encountered: