-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add tests for gutenberg_render_layout_support_flag #47719
Conversation
Flaky tests detected in 75aa876. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4081235988
|
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 adding in these tests @tellthemachines, great idea testing to make sure the main container class is output correctly! 🎉
The tests are running well for me locally, I noticed that the Github action PHP tests are failing, but it's tag processor tests that are failing, so I assume this is a potential conflict between Gutenberg trunk
and wordpress-develop
rather than anything in this PR. Once that's resolved (separately to this PR), and this is rebased, it looks like this will be in good shape to land to me ✨
), | ||
'expected_output' => '<div class="wp-block-group is-layout-constrained"></div>', | ||
), | ||
'multiple wrapper block layout with flow type' => array( |
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 idea making sure the inner wrapper logic works 👍
public function data_layout_support_flag_renders_classnames_on_wrapper() { | ||
return array( | ||
'single wrapper block layout with flow type' => array( | ||
'args' => array( |
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.
This looks good to me, but I was wondering if there's a code style preference between placing the params in a nested args
array or moving them one level up to be at the root of the array (and therefore become their own params on test_layout_support_flag_renders_classnames_on_wrapper
)? So far I haven't been nesting them further in data providers, but it does look like a good way to keep the params contained 👍
In short: this was just a comment, not anything that needs changing IMO 🙂
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.
I copied this from the get_layout_style
tests as it felt like a nice way to structure it! Not sure how widespread one or the other approach is.
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.
Ah yes, of course! Let's leave it as is, looks nice to me, too, I'll probably borrow it next time I'm writing a data provider 🙂
Just to close the loop, the failing PHP tests should be resolved by: #47720 |
bf4d643
to
75aa876
Compare
What?
Adding some unit tests for
gutenberg_render_layout_support_flag
because it didn't have any.Testing Instructions
Check out the branch and run
npm run test:unit:php
.Testing Instructions for Keyboard
Screenshots or screencast