-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
PaletteEdit: add changelog #46095
PaletteEdit: add changelog #46095
Conversation
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
Size Change: 0 B Total Size: 1.33 MB ℹ️ View Unchanged
|
428bc8e
to
d5bdac6
Compare
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.
Thanks for the follow-up PR! Just left a couple of nits, and a question about whether we can use the existing labels within each component as targets for the test, instead of adding an additional aria-label
value at the wrapper level, since it sounds like aria-label
is intended to be used on interactive elements rather than wrappers, as far as I can tell.
Let me know if I'm way off, though!
d5bdac6
to
03b2045
Compare
slugPrefix: '', | ||
}; | ||
|
||
it( 'opens color selector for color palettes', async () => { |
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.
Thanks for updating so quickly!
The tests are passing for me locally, but I noticed the Github Action appears to be failing. I kicked it off again, but if it still fails, would it be worth trying to remove the async
here? I wasn't sure if it's needed since the other test doesn't have it 🤔
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.
That was an oversight from previous testing. Thanks again for 👀
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.
Hrm, for some reason the test is still complaining 🤔
Happy to help debug on Monday!
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.
Yeah it's curious. fireEvent
is already wrapped in act()
apparently.
Tried using async getBy*
queries as well. Still failed. 🤷
Oh well.
835e45a
to
902a48b
Compare
If this round of testing doesn't work I think we should separate the requirement for a changelog for #45681 and the tests. The fact that it only fails on CI is troubling. 😄 |
Good idea, thanks for persevering! |
It appears to me to be related to the Popover component, which is a child of the PaletteEdit component. The Popover component's tests require the use of async testing code, but we're not taking that into account here. The only thing I can think of is to mock the component somehow 🤷 |
Oh, good catch. Would it work to use that wrapper ( |
Tried it 😄 I think the latter since we're changing props sent to the Popover, which we're then querying. Strange that the color test passed, but not the gradient 🤷 I'll look into it more deeply in a follow up. Thanks for reviewing again. |
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.
Just an approval for the changelog version 😄
65cf20a
to
57c786c
Compare
I readded the basic test to get some coverage since it was passing fine. |
- Add changelog for changes merged in #45681 - Test case for Popover
Relying on existing control aria labels to test for the presence of gradient and color pickers rather than the container.
…failing (not local)
57c786c
to
170325c
Compare
Good thinking 👍 |
* Initial commit: - Add changelog for changes merged in WordPress#45681 - Test case for Popover * Change log entry * Formatting * Changelog formatting Relying on existing control aria labels to test for the presence of gradient and color pickers rather than the container. * Remove unnecessary async function dec * Export no longer required * Testing async queries using findByLabelText because the CI tests are failing (not local) * Let's try this. * Let's try this. * What about this? * Why not * And so it continues * Removing tests so we can debug them separately * Reinstate test for color only. Gradient needs some async magic
What?
This PR adds a changelog for alterations merged in #45681
It also add a test case for PaletteEdit to ensure that the correct colorpicker is displayed. Picker functionality is covered in existing tests, e.g., packages/components/src/color-palette/test/index.tsx
Update: moving JS unit tests for gradient to a follow up since there is a
"not wrapped in act(...)" warning
that results in a fail. Probably related to the Popover. Tried many available async approaches. Maybe rejigging the component, mocking Popover might work.