Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
improve E2E test
Browse files Browse the repository at this point in the history
  • Loading branch information
gigitux committed Nov 27, 2023
1 parent 2390c43 commit a384503
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/Templates/SingleProductTemplateCompatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ function( $hook ) use ( $block_name ) {
* Since that there is a custom logic for the first and last block, we have to inject the hooks manually.
* The first block supports the following hooks:
* woocommerce_before_single_product
* woocommerce_before_single_product_summary
* woocommerce_single_product_summary
*
* The last block supports the following hooks:
* woocommerce_after_single_product
Expand All @@ -71,7 +69,6 @@ private function inject_hook_to_first_and_last_blocks( $block_content, $block, $
'before' => array(
'woocommerce_before_main_content' => $this->hook_data['woocommerce_before_main_content'],
'woocommerce_before_single_product' => $this->hook_data['woocommerce_before_single_product'],
'woocommerce_before_single_product_summary' => $this->hook_data['woocommerce_before_single_product_summary'],
),
'after' => array(),
);
Expand Down Expand Up @@ -198,7 +195,7 @@ protected function set_hook_data() {
),
),
'woocommerce_before_single_product_summary' => array(
'block_names' => array(),
'block_names' => array( 'core/post-excerpt' ),
'position' => 'before',
'hooked' => array(
'woocommerce_show_product_sale_flash' => 10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,30 @@ type Scenario = {
};

const singleOccurranceScenarios: Scenario[] = [
{
title: 'Before Main Content',
dataTestId: 'woocommerce_before_main_content',
content: 'Hook: woocommerce_before_main_content',
amount: 1,
},
{
title: 'Sidebar',
dataTestId: 'woocommerce_sidebar',
content: 'Hook: woocommerce_sidebar',
amount: 1,
},
{
title: 'Before Single Product',
dataTestId: 'woocommerce_before_single_product',
content: 'Hook: woocommerce_before_single_product',
amount: 1,
},
{
title: 'Before Single Product Summary',
dataTestId: 'woocommerce_before_single_product_summary',
content: 'Hook: woocommerce_before_single_product_summary',
amount: 1,
},
{
title: 'Before Add To Cart Button',
dataTestId: 'woocommerce_before_add_to_cart_button',
Expand All @@ -43,6 +61,18 @@ const singleOccurranceScenarios: Scenario[] = [
content: 'Hook: woocommerce_product_meta_start',
amount: 1,
},
{
title: 'Product Meta End',
dataTestId: 'woocommerce_product_meta_end',
content: 'Hook: woocommerce_product_meta_end',
amount: 1,
},
{
title: 'Share',
dataTestId: 'woocommerce_share',
content: 'Hook: woocommerce_share',
amount: 1,
},
{
title: 'After Single Product Summary',
dataTestId: 'woocommerce_after_single_product_summary',
Expand Down

0 comments on commit a384503

Please sign in to comment.