-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Components: Fixed broken className test for NumberControl
#69540
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
Components: Fixed broken className test for NumberControl
#69540
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 If 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. |
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.
Nice catch! I suspect you may referenced this code in the UnitControl
component.
Similar to the UnitControl
component, there is no accessible way to access the wrapper element of the NumberControl
component, so I think it's ok to add comments to ignore ESLint rule for now.
- The change log file needs to be updated. It would be good to add
Internal
section betweenEnhancement
andBug Fixes
section and add the changelog entry there. - Can you rebase this PR so that the E2E tests pass?
8aa8c14
to
748ed40
Compare
Hi @t-hamano, Done! Now all the tests pass. We can merge if everything looks good? |
Hey @t-hamano, I'm just following up on the pull request. Is everything looking good to proceed with the merge? |
…s#69540) * fix: className test for number-control * docs: Update changelog * docs: Update subheader Co-authored-by: im3dabasia <im3dabasia1@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
What?
Fixed the className test for NumberControl component that wasn't actually testing className application.
Discovered while working in this: #36742 (comment)
Related issue: #36742
Why?
The previous test was only checking if the component was visible (
toBeVisible()
) but not verifying whether the className was actually being applied to the component.How?
Took inspiration from the
UnitControl
test:See how
UnitControl
tests the classnamegutenberg/packages/components/src/unit-control/test/index.tsx
Lines 101 to 116 in 8aa8c14
Testing Instructions
To run the tests:
Screenshots or screencast
Screen.Recording.2025-03-12.at.11.07.23.AM.mov