TreeGrid: Add tests for callback functions#38942
Conversation
|
Size Change: +120 B (0%) Total Size: 1.15 MB
ℹ️ View Unchanged
|
ramonjd
left a comment
There was a problem hiding this comment.
Thanks for adding these tests!
LGTM
|
Thanks for the review @ramonjd! I'll merge this in now since it doesn't affect any of the component's behaviour, but let me know if anyone would like me to make any changes, and I'm happy to follow up. |
ciampo
left a comment
There was a problem hiding this comment.
Thank you @andrewserong for adding these tests!
Just a question — is there a reason why, in the tests, we're using "vanilla" tr and tds instead of TreeGridRow and TreeGridCell ?
|
Thanks for taking a look @ciampo! I actually ran into some errors with So, since I was primarily testing the contract of the callbacks, I thought the vanilla |

Description
Following on from the ListView multi-select behaviour added in #38314, this PR adds test coverage for the TreeGrid component's callback functions, to ensure that the expected contract is maintained when we make changes to the component. This includes:
onExpandRowcallback, that returns the DOM element for the row to be expandedonCollapseRowcallback, that returns the DOM element for the row to be collapsedonFocusRowcallback, that returns the event that was fired, the starting row DOM element, and the destination row DOM elementTesting Instructions
From the command line run the following:
Screenshots
Types of changes
Code quality / test coverage.
Checklist:
*.native.jsfiles for terms that need renaming or removal).