You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently in every Table with selection, the 'select all' checkbox is given a random key. This is breaking snapshot tests as the id is generated each time the test runs, and it also means that we can't use the id as a selector in test automation.
🤔 Expected Behavior?
If we can specify a key, this would be used to override the generated one so that we can have consistent output in our tests.
😯 Current Behavior
A new key is generated on every test run, and there is no way to override it.
This is called from the constructor of useTableState: useTableState.ts
Perhaps we could pass a prop in TableStateProps the same way that we pass showSelectionCheckboxes - this would be passed down in the context and then used when creating the selection column.
🔦 Context
This issue means that we can't write snapshot tests for Table components or pages that use a Table, and it also means we can't use the id as a selector in test automation.
💻 Examples
No response
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered:
Provide a general summary of the feature here
Currently in every Table with selection, the 'select all' checkbox is given a random key. This is breaking snapshot tests as the id is generated each time the test runs, and it also means that we can't use the id as a selector in test automation.
🤔 Expected Behavior?
If we can specify a key, this would be used to override the generated one so that we can have consistent output in our tests.
😯 Current Behavior
A new key is generated on every test run, and there is no way to override it.
💁 Possible Solution
I found where in the code that the key is set: TableCollection.ts
This is called from the constructor of useTableState: useTableState.ts
Perhaps we could pass a prop in
TableStateProps
the same way that we passshowSelectionCheckboxes
- this would be passed down in the context and then used when creating the selection column.🔦 Context
This issue means that we can't write snapshot tests for Table components or pages that use a Table, and it also means we can't use the id as a selector in test automation.
💻 Examples
No response
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered: