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

Theme e2e tests #320

Merged
merged 29 commits into from
May 2, 2022
Merged

Theme e2e tests #320

merged 29 commits into from
May 2, 2022

Conversation

PatelUtkarsh
Copy link
Collaborator

@PatelUtkarsh PatelUtkarsh commented Mar 16, 2022

Summary

Fixes #317

Checklist

  • My pull request is addressing an open issue (please create one otherwise).
  • My code is tested and passes existing tests.
  • My code follows the Contributing Guidelines (updates are often made to the guidelines, check it out periodically).

@PatelUtkarsh PatelUtkarsh force-pushed the theme-unit-tests branch 2 times, most recently from 7064fbd to 469c6d7 Compare April 8, 2022 11:18
@PatelUtkarsh PatelUtkarsh marked this pull request as ready for review April 8, 2022 12:25
@PatelUtkarsh
Copy link
Collaborator Author

Note there are some blocks which are skipped in e2e for 5.6 and 5.7 where they break.

We have not added logic to skip that from build.

Copy link
Collaborator

@emeaguiar emeaguiar left a comment

Choose a reason for hiding this comment

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

@PatelUtkarsh Just a couple questions, everything else looks good to me

bin/php-tests.sh Outdated Show resolved Hide resolved
@@ -80,7 +80,7 @@ public function action_register_blocks() {
$args ['render_callback'] = [ static::class, 'render' ];
}

register_block_type( $folder, $args );
register_block_type_from_metadata( $folder, $args );
Copy link
Collaborator

Choose a reason for hiding this comment

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

@PatelUtkarsh afaik register_block_type calls register_block_type_from_metadata and it's the preferred method, is this for legacy?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes for legacy WP 5.6.

@@ -26,7 +26,7 @@
global $_theme_files;
$_theme_files = [];

$_theme_root = realpath( __DIR__ . '/..' );
$_theme_root = 'material-design-google';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible the root of the theme can change? Maybe the user changes the folder name

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here (in bin/php-tests.sh) we are setting soft link from theme to installed WP:

Which requires theme root to be hard-coded as otherwise it will come as theme.

https://github.com/material-components/material-design-for-wordpress/pull/320/files#diff-e8ed461a365df1059241c066220cfea782c37b68a047fe8ad37910a870a91f8bR208

Co-authored-by: Mario Aguiar <mario.aguiar@xwp.co>
@PatelUtkarsh PatelUtkarsh merged commit a82ef8e into full-site-editing May 2, 2022
@PatelUtkarsh PatelUtkarsh deleted the theme-unit-tests branch May 2, 2022 12:56
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.

None yet

2 participants