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
[core] Use describeTreeView
for selection tests
#12647
Conversation
@@ -98,9 +92,6 @@ describeTreeView<UseTreeViewExpansionSignature>( | |||
}); | |||
|
|||
fireEvent.click(response.getItemContent('2')); | |||
act(() => { |
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.
Forgot to remove those when moving the focus from the tree to the item
@@ -270,6 +258,35 @@ describeTreeView<UseTreeViewExpansionSignature>( | |||
}); | |||
}); | |||
|
|||
// The `aria-expanded` attribute is used by the `response.isItemExpanded` method. |
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.
Found those tests while migrating the selection tests
Deploy preview: https://deploy-preview-12647--material-ui-x.netlify.app/ |
describeTreeView
for selection tests
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.
LGTM 👌 🎉
I have doubt about some of the current behaviors, which IMHO are not what the ARIA spec describes (clicking on a selected item in single selection does not un-select it, but the specs say that it should "toggle" the selection)
I agree. Maybe we should create an issue/notion page for these inconsistencies with the ARIA specs and discuss how to handle them
packages/x-tree-view/src/internals/plugins/useTreeViewSelection/useTreeViewSelection.test.tsx
Outdated
Show resolved
Hide resolved
packages/x-tree-view/src/internals/plugins/useTreeViewSelection/useTreeViewSelection.test.tsx
Outdated
Show resolved
Hide resolved
packages/x-tree-view/src/internals/plugins/useTreeViewSelection/useTreeViewSelection.test.tsx
Outdated
Show resolved
Hide resolved
packages/x-tree-view/src/internals/plugins/useTreeViewSelection/useTreeViewSelection.test.tsx
Outdated
Show resolved
Hide resolved
Here it is: #12654 |
Part of #12433
Most tests are just migration with unified API from existing tests.
I did not remove any test.
I have doubt about some of the current behaviors, which IMHO are not what the ARIA spec describes (clicking on a selected item in single selection does not un-select it, but the specs say that it should "toggle" the selection). But for now I migrated all the tests without touching the behaviors to avoid mixing the two.