Relocate helper (child) themes (#47080)

* Relocate helper (child) themes

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Correct wrong template slugs

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Niels Lange 2024-05-02 21:23:52 +07:00 committed by GitHub
parent 296c0cfb23
commit 6066c082b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
68 changed files with 90 additions and 77 deletions

View File

@ -21,8 +21,14 @@
"https://downloads.wordpress.org/theme/storefront.latest-stable.zip",
"https://downloads.wordpress.org/theme/twentytwentyone.latest-stable.zip",
"https://downloads.wordpress.org/theme/twentytwentyfour.latest-stable.zip",
"./tests/mocks/emptytheme",
"./tests/mocks/theme-with-woo-templates"
"./tests/e2e/themes/emptytheme",
"./tests/e2e/themes/storefront-child__block-notices-filter",
"./tests/e2e/themes/storefront-child__block-notices-template",
"./tests/e2e/themes/storefront-child__classic-notices-template",
"./tests/e2e/themes/theme-with-woo-templates",
"./tests/e2e/themes/twentytwentyfour-child__block-notices-filter",
"./tests/e2e/themes/twentytwentyfour-child__block-notices-template",
"./tests/e2e/themes/twentytwentyfour-child__classic-notices-template"
],
"config": {
"JETPACK_AUTOLOAD_DEV": true,

View File

@ -1,23 +0,0 @@
#!/usr/bin/env bash
# Get the directory of the current script.
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# The theme dir is two levels up from where this script is running.
themes_dir="$script_dir/../../themes"
# Delete the child themes if they already exist.
wp theme delete storefront-child__block-notices-filter
wp theme delete storefront-child__block-notices-template
wp theme delete storefront-child__classic-notices-template
wp theme delete twentytwentyfour-child__block-notices-filter
wp theme delete twentytwentyfour-child__block-notices-template
wp theme delete twentytwentyfour-child__classic-notices-template
# Install the child themes.
wp theme install "$themes_dir/storefront-child__block-notices-filter.zip"
wp theme install "$themes_dir/storefront-child__block-notices-template.zip"
wp theme install "$themes_dir/storefront-child__classic-notices-template.zip"
wp theme install "$themes_dir/twentytwentyfour-child__block-notices-filter.zip"
wp theme install "$themes_dir/twentytwentyfour-child__block-notices-template.zip"
wp theme install "$themes_dir/twentytwentyfour-child__classic-notices-template.zip"

View File

@ -6,34 +6,6 @@ script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
head_dir=$(cd "$(dirname "$script_dir")" && cd ../../.. && pwd)
relative_path=${script_dir#$head_dir/}
# Generate the child themes zip files before running the tests.
# By doing so, we ensure that the zip files are up-to-date.
themes_dir="$script_dir/themes"
themes=(
"storefront-child__block-notices-filter"
"storefront-child__block-notices-template"
"storefront-child__classic-notices-template"
"twentytwentyfour-child__block-notices-filter"
"twentytwentyfour-child__block-notices-template"
"twentytwentyfour-child__classic-notices-template"
)
for theme in "${themes[@]}"; do
# Define the path to the theme directory and the zip file.
theme_dir="$themes_dir/$theme"
zip_file="$themes_dir/$theme.zip"
# Check if the zip file exists. If it does, delete it.
if [ -f "$zip_file" ]; then
echo "Deleting existing zip file for $theme."
rm "$zip_file"
fi
# Navigate to the themes directory to ensure the zip contains only the theme folder name.
# Then, create a fresh zip file.
echo "Creating zip file for $theme."
(cd "$themes_dir" && zip -r "$zip_file" "$theme" -x "*.git*" -x "*node_modules*")
done
# Run the main script in the container for better performance.
wp-env run tests-cli -- bash wp-content/plugins/woocommerce/blocks-bin/playwright/scripts/index.sh
wp-env run tests-cli wp option update woocommerce_coming_soon 'no'

View File

@ -1,4 +0,0 @@
/*
Theme Name: Storefront Child (Block Notices by filter)
Template: storefront
*/

View File

@ -1,4 +0,0 @@
/*
Theme Name: Storefront Child (Block Notices by template)
Template: storefront
*/

View File

@ -1,4 +0,0 @@
/*
Theme Name: Storefront Child (Classic Notices by template)
Template: storefront
*/

View File

@ -1,4 +0,0 @@
/*
Theme Name: Twenty Twenty-Four Child (Block Notices by filter)
Template: twentytwentyfour
*/

View File

@ -1,4 +0,0 @@
/*
Theme Name: Twenty Twenty-Four Child (Block Notices by template)
Template: twentytwentyfour
*/

View File

@ -1,4 +0,0 @@
/*
Theme Name: Twenty Twenty-Four Child (Classic Notices by template)
Template: twentytwentyfour
*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,13 @@
/**
* Theme Name: Storefront Child (block notices by filter)
* Theme URI: https://github.com/woocommerce/woocommerce/
* Template: storefront
* Description: Storefront child theme to test block notices by filter.
* Version: 1.0
* Author: WooCommerce
* Author URI: https://woo.com
* Requires at least: 5.3
* Requires PHP: 5.6
* License: GNU General Public License v2.0 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,13 @@
/**
* Theme Name: Storefront Child (block notices by template)
* Theme URI: https://github.com/woocommerce/woocommerce/
* Template: storefront
* Description: Storefront child theme to test block notices by template.
* Version: 1.0
* Author: WooCommerce
* Author URI: https://woo.com
* Requires at least: 5.3
* Requires PHP: 5.6
* License: GNU General Public License v2.0 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,13 @@
/**
* Theme Name: Storefront Child (classic notices by template)
* Theme URI: https://github.com/woocommerce/woocommerce/
* Template: storefront
* Description: Storefront child theme to test classic notices by template.
* Version: 1.0
* Author: WooCommerce
* Author URI: https://woo.com
* Requires at least: 5.3
* Requires PHP: 5.6
* License: GNU General Public License v2.0 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,13 @@
/**
* Theme Name: Twenty Twenty-Four Child (block notices by filter)
* Theme URI: https://github.com/woocommerce/woocommerce/
* Template: twentytwentyfour
* Description: Twenty Twenty-Four child theme to test block notices by filter.
* Version: 1.0
* Author: WooCommerce
* Author URI: https://woo.com
* Requires at least: 5.3
* Requires PHP: 5.6
* License: GNU General Public License v2.0 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,13 @@
/**
* Theme Name: Twenty Twenty-Four Child (block notices by template)
* Theme URI: https://github.com/woocommerce/woocommerce/
* Template: twentytwentyfour
* Description: Twenty Twenty-Four child theme to test block notices by template.
* Version: 1.0
* Author: WooCommerce
* Author URI: https://woo.com
* Requires at least: 5.3
* Requires PHP: 5.6
* License: GNU General Public License v2.0 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,13 @@
/**
* Theme Name: Twenty Twenty-Four Child (classic notices by template)
* Theme URI: https://github.com/woocommerce/woocommerce/
* Template: twentytwentyfour
* Description: Twenty Twenty-Four child theme to test classic notices by template.
* Version: 1.0
* Author: WooCommerce
* Author URI: https://woo.com
* Requires at least: 5.3
* Requires PHP: 5.6
* License: GNU General Public License v2.0 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
Load e2e test helper (child) themes via .wp-json instead of via WP-CLI.