CustomSelect: add tests for new features#58583
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core SVNIf you're a Core Committer, use this list when committing to GitHub Merge commitsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
mirka
left a comment
There was a problem hiding this comment.
I had a few thoughts, but no blockers 👍
And thanks for the note in the description about toHaveTextContent — it was helpful!
packages/components/src/custom-select-control-v2/test/index.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/custom-select-control-v2/test/index.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/custom-select-control-v2/test/index.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/custom-select-control-v2/test/index.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/custom-select-control-v2/test/index.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/custom-select-control-v2/test/index.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/custom-select-control-v2/test/index.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/custom-select-control-v2/test/index.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/custom-select-control-v2/test/index.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/custom-select-control-v2/test/index.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/custom-select-control-v2/test/index.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/custom-select-control-v2/test/index.tsx
Outdated
Show resolved
Hide resolved
81e9fd8 to
1861978
Compare
c04010f to
6ea8733
Compare
6ea8733 to
95a9882
Compare
ciampo
left a comment
There was a problem hiding this comment.
LGTM 🚀
We can always iterate in follow-up PRs with more tests as needed
What?
I planned to add additional tests for the new component once #57902 is merged. However, I think it would be good to do this before for additional checks that the new features continue to work.
Why?
To ensure new features work as intended and future changes like the legacy adapter don't break these features.
How?
Adding tests for features that aren't included in
CustomSelectControl(which will be included in this component's tests, after merging #57902).Note
We were hoping with the ariakit version we could improve tests so instead of
toHaveTextContentwe would asserttoHaveValue. However, there isn't avalueattribute since it's not an HTML input. We could consider adding a data attribute if that would be better than checking the option's text content.Testing Instructions
npm run:test packages/components/src/custom-select-control-v2/test/index.tsx