-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add some tests for TreeGrid. Update README to reflect latest functionality. #39302
Conversation
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.
A few notes.
@@ -275,6 +275,10 @@ function TreeGrid( | |||
); | |||
focusablesInNextRow[ nextIndex ].focus(); | |||
|
|||
// Let consumers know the row that was originally focused, |
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.
I guess this was missed in the original PR review. My bad.
@@ -97,16 +97,16 @@ describe( 'TreeGrid', () => { | |||
</TreeGrid> | |||
); | |||
|
|||
screen.getByText( 'Row 2' ).focus(); | |||
const row2Element = screen.getByText( 'Row 2' ).closest( 'tr' ); | |||
screen.getByText( 'Row 1' ).focus(); |
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.
This was necessary as row 1 will do the collapsing/expanding now.
Size Change: -15 B (0%) Total Size: 1.16 MB
ℹ️ View Unchanged
|
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.
Thank you as always, @alexstine!
Changes LGTM, although let's wait for @talldan 's review in case they have anything to add :)
One small note — could you just add an entry to the @wordpress/components
CHANGELOG mentioning the change to the onFocusRow
callback?
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.
Looks good to me, too! Thanks for these.
I cherry-picked this PR into Gutenberg 12.8 release to prevent issues with the merge conflicts in the CHANGELOG file while publishing to npm with the automated script. |
…ality. (#39302) * Start working on updating/implementing new tests. * Update README docs. * Add tests for Home/End. Fix missing onFocus consumer for Home/End. * Add item to changelog. * A few more changelog details. * Fix changelog formatting.
What?
The PR is adding some missing unit tests for the TreeGrid component. It is also clearing up the README.
Why?
Chores are important to keep our code working. 👍
How?
Hopefully all checks will turn green and there will be more test data to prevent against regressions in the future.
Testing Instructions
Wait for PR checks to turn green or test locally with the below command.
Screenshots or screencast