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

Commit

Permalink
Fix Filter blocks e2e tests (#10116)
Browse files Browse the repository at this point in the history
* Revert "fix save method"

This reverts commit f6623c5.

* Revert "Revert "fix save method""

This reverts commit 739db2e.

* Update Filter by Attribute and Filter by Stock e2e test fixtures

* Update Filter by Attribute 'can hide product count' test
  • Loading branch information
Aljullu authored Jul 6, 2023
1 parent 045e7b9 commit 1a7365d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"title":"Filter by Attribute Block","pageContent":"<!-- wp:woocommerce/filter-wrapper {\"filterType\":\"attribute-filter\",\"heading\":\"Filter by Capacity\"} --><div class=\"wp-block-woocommerce-filter-wrapper\"><!-- wp:heading {\"level\":3} --><h3>Filter by Capacity</h3><!-- /wp:heading --><!-- wp:woocommerce/attribute-filter {\"heading\":\"\",\"lock\":{\"remove\":true}} --><div class=\"wp-block-woocommerce-attribute-filter is-loading\"><span aria-hidden=\"true\" class=\"wc-block-product-attribute-filter__placeholder\"></span></div><!-- /wp:woocommerce/attribute-filter --></div><!-- /wp:woocommerce/filter-wrapper --></div><!-- wp:woocommerce/all-products {\"columns\":3,\"rows\":3,\"alignButtons\":false,\"contentVisibility\":{\"orderBy\":true},\"orderby\":\"date\",\"layoutConfig\":[[\"woocommerce/product-image\"],[\"woocommerce/product-title\"],[\"woocommerce/product-price\"],[\"woocommerce/product-rating\"],[\"woocommerce/product-button\"]]} -->\n<div class=\"wp-block-woocommerce-all-products wc-block-all-products\" data-attributes=\"{&quot;alignButtons&quot;:false,&quot;columns&quot;:3,&quot;contentVisibility&quot;:{&quot;orderBy&quot;:true},&quot;isPreview&quot;:false,&quot;layoutConfig&quot;:[[&quot;woocommerce/product-image&quot;],[&quot;woocommerce/product-title&quot;],[&quot;woocommerce/product-price&quot;],[&quot;woocommerce/product-rating&quot;],[&quot;woocommerce/product-button&quot;]],&quot;orderby&quot;:&quot;date&quot;,&quot;rows&quot;:3}\"></div>\n<!-- /wp:woocommerce/all-products -->"}
{"title":"Filter by Attribute Block","pageContent":"<!-- wp:woocommerce/filter-wrapper {\"filterType\":\"attribute-filter\",\"heading\":\"Filter by Capacity\"} --><div class=\"wp-block-woocommerce-filter-wrapper\"><!-- wp:heading {\"level\":3} --><h3>Filter by Capacity</h3><!-- /wp:heading --><!-- wp:woocommerce/attribute-filter {\"heading\":\"\",\"lock\":{\"remove\":true}} --><div class=\"wp-block-woocommerce-attribute-filter is-loading\"></div><!-- /wp:woocommerce/attribute-filter --></div><!-- /wp:woocommerce/filter-wrapper --></div><!-- wp:woocommerce/all-products {\"columns\":3,\"rows\":3,\"alignButtons\":false,\"contentVisibility\":{\"orderBy\":true},\"orderby\":\"date\",\"layoutConfig\":[[\"woocommerce/product-image\"],[\"woocommerce/product-title\"],[\"woocommerce/product-price\"],[\"woocommerce/product-rating\"],[\"woocommerce/product-button\"]]} -->\n<div class=\"wp-block-woocommerce-all-products wc-block-all-products\" data-attributes=\"{&quot;alignButtons&quot;:false,&quot;columns&quot;:3,&quot;contentVisibility&quot;:{&quot;orderBy&quot;:true},&quot;isPreview&quot;:false,&quot;layoutConfig&quot;:[[&quot;woocommerce/product-image&quot;],[&quot;woocommerce/product-title&quot;],[&quot;woocommerce/product-price&quot;],[&quot;woocommerce/product-rating&quot;],[&quot;woocommerce/product-button&quot;]],&quot;orderby&quot;:&quot;date&quot;,&quot;rows&quot;:3}\"></div>\n<!-- /wp:woocommerce/all-products -->"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"title":"Filter Products by Stock Block","pageContent":"<!-- wp:woocommerce/filter-wrapper {\"filterType\":\"stock-filter\",\"heading\":\"Filter by stock status\"} --><div class=\"wp-block-woocommerce-filter-wrapper\"><!-- wp:heading {\"level\":3} --><h3>Filter by stock status</h3><!-- /wp:heading --><!-- wp:woocommerce/stock-filter {\"heading\":\"\",\"lock\":{\"remove\":true,\"move\":true}} --><div class=\"wp-block-woocommerce-stock-filter is-loading\"><span aria-hidden=\"true\" class=\"wc-block-product-stock-filter__placeholder\"></span></div><!-- /wp:woocommerce/stock-filter --></div><!-- /wp:woocommerce/filter-wrapper --></div>"}
{"title":"Filter Products by Stock Block","pageContent":"<!-- wp:woocommerce/filter-wrapper {\"filterType\":\"stock-filter\",\"heading\":\"Filter by stock status\"} --><div class=\"wp-block-woocommerce-filter-wrapper\"><!-- wp:heading {\"level\":3} --><h3>Filter by stock status</h3><!-- /wp:heading --><!-- wp:woocommerce/stock-filter {\"heading\":\"\",\"lock\":{\"remove\":true,\"move\":true}} --><div class=\"wp-block-woocommerce-stock-filter is-loading\"></div><!-- /wp:woocommerce/stock-filter --></div><!-- /wp:woocommerce/filter-wrapper --></div>"}
4 changes: 2 additions & 2 deletions tests/e2e/specs/backend/attribute-filter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ describe( `${ block.name } Block`, () => {
} );

it( 'can hide product count', async () => {
await expect( page ).toMatchElement(
await expect( page ).not.toMatchElement(
'.wc-filter-element-label-list-count'
);
await expect( page ).toClick( 'label', {
text: 'Display product count',
} );
await expect( page ).not.toMatchElement(
await expect( page ).toMatchElement(
'.wc-filter-element-label-list-count'
);
// reset
Expand Down

0 comments on commit 1a7365d

Please sign in to comment.