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

test : Add tests for Core Image Block #30

Closed
wants to merge 10 commits into from
Closed

test : Add tests for Core Image Block #30

wants to merge 10 commits into from

Conversation

Ta5r
Copy link
Collaborator

@Ta5r Ta5r commented Sep 25, 2024

Tracking wpengine#306

@Ta5r Ta5r self-assigned this Sep 25, 2024
Comment on lines 5 to 7
final class CoreImageTest extends PluginTestCase {
public $instance;

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
final class CoreImageTest extends PluginTestCase {
public $instance;
final class CoreImageTest extends PluginTestCase {

Comment on lines 47 to 51
* Get the query for the CoreImage block.
*
* @param string $attributes The attributes to add to query.
*/
public function query( $attributes = '' ): string {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This new param isnt in use, lets remove it.

(If it was in use, there'd be a longer discussion whether the ingenuity here outweights a general desire to not obfuscate whats getting tested. Either way, smart approach 🙌)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh yes, i was actually using it to return a valid query for every untested attribute ( ) check by just passing that label to it. but later i thought to instead use the query in each case to make it more readable

* - scale
* - lightbox
*/
public function test_retrieve_core_untested_attributes(): void {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Break this into two separate tests please.
At the top of each, gate it and $this->markTestSkipped() if its not the right WordPress version (like its done elsewhere), instead of wrapping the tests inside conditional logic.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done ✅

Copy link
Collaborator

@justlevine justlevine left a comment

Choose a reason for hiding this comment

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

Looks good, just need to split the lightbox (WP6.4) test from the WP6.3 ones, a bit of cleanup, and an updated PR description, and this should be good to go.

Change the PR from draft to ready for review once the above is done and I'll give my final signoff.

@Ta5r Ta5r marked this pull request as ready for review October 1, 2024 10:50
@Ta5r Ta5r requested a review from justlevine October 1, 2024 10:53
Copy link
Collaborator

@justlevine justlevine left a comment

Choose a reason for hiding this comment

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

Looks good! Go ahead and open this up on WPE

@Ta5r
Copy link
Collaborator Author

Ta5r commented Oct 1, 2024

May I proceed to merge this pull request ? @justlevine 😃

@justlevine
Copy link
Collaborator

justlevine commented Oct 1, 2024

@Ta5r only if you want to rebase #31 when you're done ;-). Otherwise let's hold off

@justlevine justlevine closed this Oct 18, 2024
@justlevine justlevine deleted the core-image-test branch October 18, 2024 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants