woocommerce/plugins/woocommerce-blocks/tests/e2e/utils
Albert Juhé Lluveras 1687d462fb
Initialize BlockTemplatesController for block themes only (#48905)
* Move `check_should_use_blockified_product_grid_templates` to `wc-template-functions.php`

* add changelog entry

* alias Blocks/Options as BlocksOptions

* Init `BlockTemplatesController` for block themes only

* Remove the `wc_current_theme_is_fse_theme()` check from BTC

* Streamline the option update logic a tad

* Revert "Streamline the option update logic a tad"

This reverts commit 54a965d9784df253f82533991e03c1112fd386ef.

* init BTC for themes that support block template parts

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* init BTC for themes that support block template parts, p.2

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* move the check to a new OptionsManager class

* make types consistent

* add classic theme with block template parts support

* tmp: add logs for debugging

* Initialize BlockTemplatesController on init

* Remove debugging code

* Prevent duplicate template parts appearing in the Site Editor in classic themes that support template parts

* Update e2e tests for classic themes that support template parts

* Fix Checkout header not being rendered

* Fix PHP tests

* Simplify WC_BLOCK_USE_BLOCKIFIED_PRODUCT_GRID_BLOCK_AS_TEMPLATE logic

* Rename OptionsManager class to TemplateOptions

* Change format of inline comment

* Use wc()->is_store_api_request()

* Update plugins/woocommerce/src/Blocks/TemplateOptions.php

Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>

* Update testing theme slugs

* Add strict_types to TemplateOptions file

* Refactor check_should_use_blockified_product_grid_templates()

* Don't update 'wc_blocks_use_blockified_product_grid_block_as_template' when switching between block themes

* Add extra unit test to make sure the option is not updated when switching between block themes

* Update strict_types format

* Remove unnecessary theme switch after tests finish running

* Replace .toHaveCount( 0 ) with .toBeHidden() in several tests

* Create a TestUtils to abstract logic to open Mini-Cart block

* Remove unnecessary import

* Replace .toHaveCount( 0 ) with .toBeHidden() in several tests (II)

---------

Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>
Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
2024-07-03 11:31:41 +02:00
..
admin Blocks E2E: Streamline E2E utils implementation (#47660) 2024-05-27 14:54:06 +00:00
editor Add back revert template e2e tests (#48805) 2024-06-26 15:15:38 +02:00
frontend Update Playwright to 1.44.1 from 1.41.1 (#48291) 2024-06-11 21:52:48 +03:00
local-pickup Settings Save button disable/enable (#47444) 2024-06-25 13:12:14 +12:00
mini-cart Update Playwright to 1.44.1 from 1.41.1 (#48291) 2024-06-11 21:52:48 +03:00
navigation Blocks E2E: Streamline E2E utils implementation (#47660) 2024-05-27 14:54:06 +00:00
performance Allow usage of block notice templates when using classic themes (#45164) 2024-03-14 19:33:33 +07:00
request-utils Blocks E2E: Streamline E2E utils implementation (#47660) 2024-05-27 14:54:06 +00:00
shipping Settings Save button disable/enable (#47444) 2024-06-25 13:12:14 +12:00
storeApi Add Playwright tests for All Reviews, Reviews by Product and Reviews by Category blocks (#42903) 2023-12-22 09:33:18 +01:00
constants.ts Initialize BlockTemplatesController for block themes only (#48905) 2024-07-03 11:31:41 +02:00
index.ts Blocks E2E: Streamline the usage of WP CLI (#47869) 2024-05-28 17:09:28 +02:00
test.ts Blocks E2E: Streamline the usage of WP CLI (#47869) 2024-05-28 17:09:28 +02:00
types.ts Blocks E2E: Streamline E2E utils implementation (#47660) 2024-05-27 14:54:06 +00:00
wp-cli.ts Blocks E2E: Streamline the usage of WP CLI (#47869) 2024-05-28 17:09:28 +02:00