Skip to content
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

CustomSelect: add tests for new features #58583

Merged
merged 5 commits into from
Feb 6, 2024
Merged

Conversation

brookewp
Copy link
Contributor

@brookewp brookewp commented Feb 2, 2024

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 toHaveTextContent we would assert toHaveValue. However, there isn't a value attribute 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

@brookewp brookewp added [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Package] Components /packages/components labels Feb 2, 2024
@brookewp brookewp requested a review from a team February 2, 2024 00:38
@brookewp brookewp self-assigned this Feb 2, 2024
@brookewp brookewp requested a review from ajitbohra as a code owner February 2, 2024 00:38
Copy link

github-actions bot commented Feb 2, 2024

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 props-bot label.

Core SVN

If you're a Core Committer, use this list when committing to wordpress-develop in SVN:

Props: brookemk, 0mirka00, mciampini.

GitHub Merge commits

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: brookewp <brookemk@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Member

@mirka mirka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a few thoughts, but no blockers 👍

And thanks for the note in the description about toHaveTextContent — it was helpful!

Copy link
Contributor

@ciampo ciampo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just reliased I have review comments pending since yesterday and I forgot to submit them 😭 Some of them are duplicates of Lena's comments, you'll get a nice 2x1 when solving them 😄

@brookewp brookewp force-pushed the add/newcustomselect-tests branch from 81e9fd8 to 1861978 Compare February 5, 2024 22:23
@brookewp brookewp requested review from mirka and ciampo February 5, 2024 22:29
@brookewp brookewp force-pushed the add/newcustomselect-tests branch from c04010f to 6ea8733 Compare February 6, 2024 04:26
@brookewp brookewp force-pushed the add/newcustomselect-tests branch from 6ea8733 to 95a9882 Compare February 6, 2024 05:06
Copy link
Contributor

@ciampo ciampo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

We can always iterate in follow-up PRs with more tests as needed

@ciampo ciampo merged commit 519824a into trunk Feb 6, 2024
59 checks passed
@ciampo ciampo deleted the add/newcustomselect-tests branch February 6, 2024 09:17
@github-actions github-actions bot added this to the Gutenberg 17.7 milestone Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants