Commit Graph

829 Commits

Author SHA1 Message Date
Albert Juhé Lluveras b0ab7ba213
Fix Merchant → Mini Cart in FSE editor can only be inserted once test (#47134)
* Fix Merchant → Mini Cart in FSE editor can only be inserted once test

* Add changelog file
2024-05-03 11:58:53 +02:00
Sam Seay 3a5721c0d8
Replace @wordpress/components Button, Radio, RadioGroup with Ariakit Button (#45974) 2024-05-03 15:28:39 +12:00
Niels Lange 6066c082b0
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>
2024-05-02 21:23:52 +07:00
Luigi Teschio bbcc73ebeb
Migrate Jest Puppeteer E2E tests to Playwright (#46644)
* try db reset in page teardown

* move reset to setup step

* Use wp db cli

* Fix global setup
That part is overriding the logged in user state and wipes out the nonce and rootUrl fields.

* Try importing instead from a generated dump

* Revert "Try importing instead from a generated dump"

This reverts commit 987dc471c9.

* Revert "Revert "Try importing instead from a generated dump""

This reverts commit c8d008cb20.

* Don't bypass visitSiteEditor so that the Welcome Guide is closed

* use createNewPost

* Revert "Revert "Revert "Try importing instead from a generated dump"""

This reverts commit 2684273582.

* [Blocks]: Fix E2E tests (#46344)

* Load local pickup enabled setting as bool not string

* Add changelog

* Remove unused import

* Update plugins/woocommerce-blocks/assets/js/extensions/shipping-methods/pickup-location/utils.ts

Co-authored-by: Niels Lange <info@nielslange.de>

* Use strict equality test

* try now

* try now

* add a new sql file

* remove default.sql

* fix welcome guide tour

* fix E2E tests

* Fix the template revert tests
...where the template is unreachable due to pagination.

* Add changelog entry

* improve logic to closeWelcomeGuideModal

* fix cart checkout tests

* improve flakiness

* improve flakiness

* fix flaky test

* fix company field

* fix E2E test

* fix E2E tests

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>

* Replace beforeAll w/ beforeEach + remove all after* hooks

* Fix broken hooks

* Activate plugins via requestUtils API

* [Blocks - E2E]: Add `playwright/no-hooks` ESlint rule (#46432)

add ESLint configuration

* Clean up console logs

* Remove obsolete language setup steps

* Remove more unnecessary setup steps

* Remove even more obsolete setup steps

* tmp: add the LYS fix

* Try stabilizing the company field test

* Use canvas param instead of manually entering edit mode

* Remove double site editor redirect

* Revert "Use canvas param instead of manually entering edit mode"

This reverts commit 5e6cc17154.

* Revert "Remove double site editor redirect"

This reverts commit 69a57a82a8.

* Fix flaky products sorting test

* Blocks: Fix ESLint errors (#46595)

fix eslint error

* Fix ESLint errors (#46626)

* Fix ESLint errors

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

---------

Co-authored-by: github-actions <github-actions@github.com>

* Blocks: Migrate multiple tests to Playwright

* fix path

* migrate other tests

* add product best sellers E2E tests

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

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

* Remove obsolete waitForLoadState call

* improve E2E tests

* fix E2E tests

* fix E2E test

* remove not necessary changelog

* improve E2E tests

* remove not necessary folder

* fix test

---------

Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: github-actions <github-actions@github.com>
2024-05-02 10:36:51 +02:00
Niels Lange 1d93ba0b6a
Block-based checkout - Shipping section changes (#46083)
* Refactor shipping sections

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

* Refactor various files and adjust e2e tests

* Display expected styles for “Ship” and “Pickup” in the page editor

* Use exact selector

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-04-30 19:59:03 +07:00
Luigi Teschio ded320df95
[Blocks] Migrate stock filter to playwright (#46580)
* try db reset in page teardown

* move reset to setup step

* Use wp db cli

* Fix global setup
That part is overriding the logged in user state and wipes out the nonce and rootUrl fields.

* Try importing instead from a generated dump

* Revert "Try importing instead from a generated dump"

This reverts commit 987dc471c9.

* Revert "Revert "Try importing instead from a generated dump""

This reverts commit c8d008cb20.

* Don't bypass visitSiteEditor so that the Welcome Guide is closed

* use createNewPost

* Revert "Revert "Revert "Try importing instead from a generated dump"""

This reverts commit 2684273582.

* [Blocks]: Fix E2E tests (#46344)

* Load local pickup enabled setting as bool not string

* Add changelog

* Remove unused import

* Update plugins/woocommerce-blocks/assets/js/extensions/shipping-methods/pickup-location/utils.ts

Co-authored-by: Niels Lange <info@nielslange.de>

* Use strict equality test

* try now

* try now

* add a new sql file

* remove default.sql

* fix welcome guide tour

* fix E2E tests

* Fix the template revert tests
...where the template is unreachable due to pagination.

* Add changelog entry

* improve logic to closeWelcomeGuideModal

* fix cart checkout tests

* improve flakiness

* improve flakiness

* fix flaky test

* fix company field

* fix E2E test

* fix E2E tests

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>

* Replace beforeAll w/ beforeEach + remove all after* hooks

* Fix broken hooks

* Activate plugins via requestUtils API

* [Blocks - E2E]: Add `playwright/no-hooks` ESlint rule (#46432)

add ESLint configuration

* Clean up console logs

* Remove obsolete language setup steps

* Remove more unnecessary setup steps

* Remove even more obsolete setup steps

* tmp: add the LYS fix

* Try stabilizing the company field test

* Use canvas param instead of manually entering edit mode

* Blocks: Migrate stock filter to playwright

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

* Remove double site editor redirect

* remove not necessary file

* fix test

* Revert "Use canvas param instead of manually entering edit mode"

This reverts commit 5e6cc17154.

* Revert "Remove double site editor redirect"

This reverts commit 69a57a82a8.

* Fix flaky products sorting test

* Blocks: Fix ESLint errors (#46595)

fix eslint error

* improve E2E tests

* fix test

* Fix ESLint errors (#46626)

* Fix ESLint errors

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

---------

Co-authored-by: github-actions <github-actions@github.com>

* address feedback

---------

Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: github-actions <github-actions@github.com>
2024-04-26 15:14:54 +02:00
Luigi Teschio 45a4817772
[Blocks] Migrate Attribute filter E2E tests to playwright (#46591)
* try db reset in page teardown

* move reset to setup step

* Use wp db cli

* Fix global setup
That part is overriding the logged in user state and wipes out the nonce and rootUrl fields.

* Try importing instead from a generated dump

* Revert "Try importing instead from a generated dump"

This reverts commit 987dc471c9.

* Revert "Revert "Try importing instead from a generated dump""

This reverts commit c8d008cb20.

* Don't bypass visitSiteEditor so that the Welcome Guide is closed

* use createNewPost

* Revert "Revert "Revert "Try importing instead from a generated dump"""

This reverts commit 2684273582.

* [Blocks]: Fix E2E tests (#46344)

* Load local pickup enabled setting as bool not string

* Add changelog

* Remove unused import

* Update plugins/woocommerce-blocks/assets/js/extensions/shipping-methods/pickup-location/utils.ts

Co-authored-by: Niels Lange <info@nielslange.de>

* Use strict equality test

* try now

* try now

* add a new sql file

* remove default.sql

* fix welcome guide tour

* fix E2E tests

* Fix the template revert tests
...where the template is unreachable due to pagination.

* Add changelog entry

* improve logic to closeWelcomeGuideModal

* fix cart checkout tests

* improve flakiness

* improve flakiness

* fix flaky test

* fix company field

* fix E2E test

* fix E2E tests

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>

* Replace beforeAll w/ beforeEach + remove all after* hooks

* Fix broken hooks

* Activate plugins via requestUtils API

* [Blocks - E2E]: Add `playwright/no-hooks` ESlint rule (#46432)

add ESLint configuration

* Clean up console logs

* Remove obsolete language setup steps

* Remove more unnecessary setup steps

* Remove even more obsolete setup steps

* tmp: add the LYS fix

* Try stabilizing the company field test

* Use canvas param instead of manually entering edit mode

* Remove double site editor redirect

* Blocks: Migrate attribute filter E2E tests to playwright

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

* Revert "Use canvas param instead of manually entering edit mode"

This reverts commit 5e6cc17154.

* Revert "Remove double site editor redirect"

This reverts commit 69a57a82a8.

* Fix flaky products sorting test

* Blocks: Fix ESLint errors (#46595)

fix eslint error

* update path

* Fix ESLint errors (#46626)

* Fix ESLint errors

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

---------

Co-authored-by: github-actions <github-actions@github.com>

* address feedback

* fix visitSiteEditor

* fix description

* remove not necessary changelog

---------

Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: github-actions <github-actions@github.com>
2024-04-26 14:35:03 +02:00
Luigi Teschio 24c2832e4f
[Blocks] Migrate rating filter to playwright (#46583)
* try db reset in page teardown

* move reset to setup step

* Use wp db cli

* Fix global setup
That part is overriding the logged in user state and wipes out the nonce and rootUrl fields.

* Try importing instead from a generated dump

* Revert "Try importing instead from a generated dump"

This reverts commit 987dc471c9.

* Revert "Revert "Try importing instead from a generated dump""

This reverts commit c8d008cb20.

* Don't bypass visitSiteEditor so that the Welcome Guide is closed

* use createNewPost

* Revert "Revert "Revert "Try importing instead from a generated dump"""

This reverts commit 2684273582.

* [Blocks]: Fix E2E tests (#46344)

* Load local pickup enabled setting as bool not string

* Add changelog

* Remove unused import

* Update plugins/woocommerce-blocks/assets/js/extensions/shipping-methods/pickup-location/utils.ts

Co-authored-by: Niels Lange <info@nielslange.de>

* Use strict equality test

* try now

* try now

* add a new sql file

* remove default.sql

* fix welcome guide tour

* fix E2E tests

* Fix the template revert tests
...where the template is unreachable due to pagination.

* Add changelog entry

* improve logic to closeWelcomeGuideModal

* fix cart checkout tests

* improve flakiness

* improve flakiness

* fix flaky test

* fix company field

* fix E2E test

* fix E2E tests

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>

* Replace beforeAll w/ beforeEach + remove all after* hooks

* Fix broken hooks

* Activate plugins via requestUtils API

* [Blocks - E2E]: Add `playwright/no-hooks` ESlint rule (#46432)

add ESLint configuration

* Clean up console logs

* Remove obsolete language setup steps

* Remove more unnecessary setup steps

* Remove even more obsolete setup steps

* tmp: add the LYS fix

* Try stabilizing the company field test

* Use canvas param instead of manually entering edit mode

* Remove double site editor redirect

* Blocks: Migrate rating filter to playwright

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

* remove not necessary changelog

* Revert "Use canvas param instead of manually entering edit mode"

This reverts commit 5e6cc17154.

* Revert "Remove double site editor redirect"

This reverts commit 69a57a82a8.

* Fix flaky products sorting test

* Blocks: Fix ESLint errors (#46595)

fix eslint error

* improve tests

* use visitSiteEditor util

Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>

* use locator.fill

* Fix ESLint errors (#46626)

* Fix ESLint errors

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

---------

Co-authored-by: github-actions <github-actions@github.com>

* address feedback

* remove not necessary changelog

---------

Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: github-actions <github-actions@github.com>
2024-04-26 12:53:07 +02:00
Luigi Teschio 417baee8ef
[Blocks] Migrate Price filter tests to Playwright (#46576)
* try db reset in page teardown

* move reset to setup step

* Use wp db cli

* Fix global setup
That part is overriding the logged in user state and wipes out the nonce and rootUrl fields.

* Try importing instead from a generated dump

* Revert "Try importing instead from a generated dump"

This reverts commit 987dc471c9.

* Revert "Revert "Try importing instead from a generated dump""

This reverts commit c8d008cb20.

* Don't bypass visitSiteEditor so that the Welcome Guide is closed

* use createNewPost

* Revert "Revert "Revert "Try importing instead from a generated dump"""

This reverts commit 2684273582.

* [Blocks]: Fix E2E tests (#46344)

* Load local pickup enabled setting as bool not string

* Add changelog

* Remove unused import

* Update plugins/woocommerce-blocks/assets/js/extensions/shipping-methods/pickup-location/utils.ts

Co-authored-by: Niels Lange <info@nielslange.de>

* Use strict equality test

* try now

* try now

* add a new sql file

* remove default.sql

* fix welcome guide tour

* fix E2E tests

* Fix the template revert tests
...where the template is unreachable due to pagination.

* Add changelog entry

* improve logic to closeWelcomeGuideModal

* fix cart checkout tests

* improve flakiness

* improve flakiness

* fix flaky test

* fix company field

* fix E2E test

* fix E2E tests

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>

* Replace beforeAll w/ beforeEach + remove all after* hooks

* Fix broken hooks

* Activate plugins via requestUtils API

* [Blocks - E2E]: Add `playwright/no-hooks` ESlint rule (#46432)

add ESLint configuration

* Clean up console logs

* Remove obsolete language setup steps

* Remove more unnecessary setup steps

* Remove even more obsolete setup steps

* tmp: add the LYS fix

* [Blocks]: Migrate Price Filter tests to Playwright

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

* improve description

* Try stabilizing the company field test

* use Product Collection

* Use canvas param instead of manually entering edit mode

* remove blockData

* Remove double site editor redirect

* Revert "Use canvas param instead of manually entering edit mode"

This reverts commit 5e6cc17154.

* Revert "Remove double site editor redirect"

This reverts commit 69a57a82a8.

* Fix flaky products sorting test

* Blocks: Fix ESLint errors (#46595)

fix eslint error

* update test

* add missing import

* Fix ESLint errors (#46626)

* Fix ESLint errors

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

---------

Co-authored-by: github-actions <github-actions@github.com>

* improve E2E tests

* remove not necessary changelog

---------

Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: github-actions <github-actions@github.com>
2024-04-26 12:07:00 +02:00
Bart Kalisz 5f7cc39330
Block E2E: Eliminate side effects through improved test isolation (#46125) 2024-04-26 11:39:11 +02:00
Alex Florisca 7dc8dd63ba
Update Order Summary Design (#45767)
* Add border around order summary on cart & checkout

* Group subtotal, discount, fees, taxes and shiping block

* Move the coupon form in order summary

* Move the coupon form in order summary

* Manage state externally in Panel component and refactor Coupon form to use the Panel component

* Remove descriptions from order summary items

* increase font weight of order summary title

* Tidy up design for desktop and add separator back in for blocks on checkout order summary

* Remove border around order summary on mobile

* Revert "Move the coupon form in order summary"

This reverts commit 4a8044cdcf.

* Change heading styles for cart

* Change font weight to 500 of order summary heading on checkout block

* Remove padding and border between order summary totals items

* Refactor css for cart & checkout totals to work in the editor

* Adjust cart totals heading in the editor

* Last adjustment to checkout totals style to work in editor

* Add changelog

* Change the cursor to pointer for the panel component

* remove unused short and full description from OrderSummaryItem

* Fix failing e2e tests

* Fix lint issues

* Vertically align order summary title in the editor

* Fix e2e tests

* Fix linting issues

* Fix unit tests

* Remove changes from woocommerce.php

* Fix checkout block test

* fix eslint errors in checkout block test

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2024-04-25 12:03:31 +07:00
Seghir Nadir 2054353f91
Add hooks when reading and writing additional fields (#46870)
* add new filters for reading and writing fields

* rename functions

* add test for action

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

* update docs

* fix typo in test and linting issues

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-04-24 17:38:15 +02:00
Albert Juhé Lluveras 738bbb0078
Move logic to hide Template selector in Shop page into Product Catalog class and add e2e test (#46405)
* Move logic to hide Template selector in Shop page into Product Catalog class

* Add changelog file

* Update plugins/woocommerce-blocks/tests/e2e/tests/templates/shop-page.block_theme.spec.ts

Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>

* Update plugins/woocommerce-blocks/tests/e2e/tests/templates/shop-page.block_theme.spec.ts

Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>

* Fix linting

---------

Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>
2024-04-24 15:57:02 +02:00
Seghir Nadir 0f621c8977
get settings in correct format for Local Pickup (#46799)
* get settings in correct format

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

* expand test to also account for frontend

* remove added test

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-04-24 15:22:36 +02:00
Albert Juhé Lluveras c59dcbe925
Create update_template_data util and formatting improvements (#46408)
* Create update_template_data util

* Fix comment typo

* Formatting

* Remove unnecessary use of BlockTemplateUtils

* Add changelog file

* Create update_template_data util (II)
2024-04-24 14:57:18 +02:00
Seghir Nadir 742cbbda9d
Graduate Additional Fields to stable and rename it. (#46805)
* graduate woocommerce_blocks_register_checkout_field

* graduate filters

* Migrate Additional to Order and Other

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

* fix markdown lint

* update tests to use old value

* fix lint issue

* pass field options by reference

* update test helpers

* update tests to use latest api

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-04-23 16:47:32 +02:00
Seghir Nadir 0f4e675fb5
Correctly serialize data in additional fields API (#46762)
* fix data sanitization on session

* add changelog
2024-04-23 15:34:31 +02:00
Bart Kalisz 190c972332
Blocks: Isolate performance tests from e2e tests (#46773)
* Isolate (cart) performance tests from e2e tests

* Add changelog entry
2024-04-23 13:11:46 +02:00
Bart Kalisz 007a4238c3
Blocks E2E: Provide correct expected translation (#46756) 2024-04-20 13:23:55 +02:00
Bart Kalisz 8da0396b34
Blocks E2E: Fix basic role-based tests (#46684) 2024-04-17 18:50:37 +02:00
Raluca Stan 466b3a8d06
Can only be inserted once test excludes the mini-cart template button (#46478)
* Can only be inserted once test excludes the mini-cart template button

* Use function for testing disabled state

* Account for blocks advertise and change selector
2024-04-16 17:15:38 +03:00
Luigi Teschio 7d41472206
[Blocks]: remove skipped tests (#46594)
* remove skipped tests

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-04-16 11:26:58 +02:00
Luigi Teschio 8653d4c4fe
Blocks - E2E: Fix visibility store (#46521)
* Blocks - E2E: Fix visibility store

* add changelog
2024-04-12 11:26:12 +00:00
Karol Manijak de54195c3a
Enable Classic Template Products by Tag test (#46428)
* Enable Product Tag template test

* Add changelog
2024-04-11 08:58:01 +02:00
Karol Manijak 7efd3d4652
Product Collection: break taxonomies filter into multiple menu items per each taxonomy (#46160)
* Split taxonomies filter into seperate filter per taxonomy

* Add changelog

* Improve onDeselect function

* Update tests

* Fix lint

* Satisfy TS by returning single React element rather than array of elements

* Remove unused variable
2024-04-11 08:13:42 +02:00
Bart Kalisz b8df34659c
Blocks E2E: Ensure legacy template slugs are supported (#46269) 2024-04-10 10:38:55 +02:00
Bart Kalisz 7f6d21395e
Blocks E2E: Fix template revert tests (#46373) 2024-04-09 17:03:00 +02:00
Seghir Nadir afee75f871
Use individual meta keys for Additional fields. (#46091)
* add regression tests

* Refactor to using single meta key per field

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

* refactor rest of code

* keep set_array_meta same

* use correct function in condition

* fix spacing

* add docs

* fix markdown issues

* handle false bool meta

* adjust admin keys

* fix merchant tests

* handle checkboxes in checkout response

* address feedback

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/additional-checkout-fields.md

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/additional-checkout-fields.md

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/additional-checkout-fields.md

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/additional-checkout-fields.md

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/additional-checkout-fields.md

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* update ledt places and reduce abstractions

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2024-04-09 12:48:27 +01:00
Leif Singer 8ee74ede0e
Update Woo.com references to WooCommerce.com (#46259)
* replace capitalized Woo.com with WooCommerce.com

* replace http URLs

* replace https URLs

* replace developer.woo.com

* add missing version in `@since` tag

* unslash the HTTP_REFERER

* WordPress.Security.ValidatedSanitizedInput.InputNotSanitized

* add changelog file

* add more changelog files

* address linter errors

* address more linter errors

* fix test

* more linter errors
2024-04-09 09:50:15 +01:00
Thomas Roberts 9f159f7141
Use address format from server in address card (#45852) 2024-04-08 01:43:42 -07:00
Sam Seay be93d94130
Fix blocks e2e test for `additional-fields.merchant.block_theme.side_effects.spec.ts` (#46258)
* Wait for DOMContentLoaded to ensure that scripts are run when we try click edit shipping details.
2024-04-06 14:54:46 +13:00
Tung Du 11ec7c6255
Fix: broken contract in StoreAPI ProductCollectionData endpoint (#45247)
* revert: use original implementation

* fix: price query clause

* chore: changelog

* fix: passing full query state to get the correct count and avoid cache issue

* Replace references to woo-gutenberg-products-block

* fix php cs error

* fix php cs error

* Fix e2e tests for attributes count

* Separated out and/or query type tests for attrs count

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: roykho <roykho77@gmail.com>
2024-04-05 15:50:19 -03:00
Karol Manijak 0c1e4efc89
Rename the "other" location from `generic` to `site` (#46228)
* Rename the useGetLocation generic option to site

* Add changelog

* Adjust tests to change
2024-04-05 15:54:56 +02:00
Sam Seay ff102c4921
Add vendor bundling of blocks frontend bundle to improve cart/checkout performance (#45859) 2024-04-04 15:31:02 +13:00
Alexandre Lara 90a9ef0392
Product Filter: Price block - Add E2E tests (#45855)
* Add E2E tests for Product Filter: Price block

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

* Use web first assertions

* Replace `toB` by `toHaveValue` in E2E tests

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-04-03 16:15:10 -03:00
Luigi Teschio b4e359ee71
E2E test env: use WordPress 6.5 stable version (#46155)
* E2E test env: use WordPress 6.5 stable version

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

* Revert "Wait for notice text to be visible instead of checking data store"

This reverts commit f26892a646.

* Revert "Fix linting errors"

This reverts commit eaf90e4890.

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2024-04-03 14:33:04 +02:00
Thomas Roberts 893c7ddb04
Sync Local Pickup title between Checkout block and shipping settings UI and vice/versa (#45720) 2024-04-02 11:34:32 +00:00
Niels Lange 5cde8c5efe
Add e2e tests for virtual orders (#45824)
* Add e2e tests for virtual orders and refactor test names

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

* Optimise setup and teardown

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-27 21:28:54 +07:00
Luigi Teschio 66b5481590
Fix E2E tests for WordPress 6.5 (#44593)
* Add sharding to Blocks e2e tests

* Changelog

* Push a change to Blocks README to trigger tests

* Fix syntax

* Fixed again

* Try again

* Trying to get the shard number

* Shard names

* fix E2E test

* use wordpress 6.5 as test env

* update util

* fix Mini Cart Block E2E test

* add editor dependency

* fix E2E tests

* fix E2E tests

* fix E2E tests

* restore global setup file

* fix E2E tests

* fix global setup

* try now

* try now

* fix E2E test

* fix E2E test

* fix mini cart E2E test

* add changelog

* complete all the jobs

* update playwright

* fix E2E tests

* fix E2E test

* try now

* fix E2E test

* not show welcome guide for the post editor

* update configuration

* fix guest storage state

* fix E2E tests

* check now

* fix E2E tests

* fix command

* improve selector

* use WordPress 6.5 beta 2

* use WordPress 6.5 beta 3

* fix canvas use

* wait for button

* fix E2E test

* fix E2E test

* fix product button

* fix product collection tests

* fix wp build link

* use beforeEach

* fix E2E tests

* use WordPress RC2

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

* trigger CI

* fix E2E tests

* fix E2E tests

* fix E2E test

* fix E2E tests

* add timeout

* Fix flaky locator assertions
...by replacing them with dedicaed auto-waiting ones.

* Apply correct use of waitForRequest/Response and remove where unnecessary

* Remove obsolete waitUntils

* Fix accidentally isolated test

* Replace saveTemplate with core's saveSiteEditorEntities

* Fix findProductRow util

* Restore necessary request waiters

* Use activateTheme util instead of cli call

* Remove unused import

* Fix request destructured call
Request properties cannot be destructured (todo: create upstream issue)

* Revert some waitForRequest changes
These need to be investigated for heavy bleeding from side-effects

* Fix failing cart checkout test

* Set navigation timeout to 10s
We need this so that API like page.goto or page.waitForURL doesn't take 100 seconds (global timeout) to throw.

* Do not close the page in the page fixture override
The page will be closed anyway, and by closing it explicitly in the teardown phase of the fixture we create a flaky race condition where the page might be closed before the action/navigation timeout is reached, resulting in "page closed!" error instead of, e.g. "locator.fill timed out".

* Revert product collection tests due to conflicts

* Try fixing E2E test

* Remove some random change

* Revert to programmatic blur 🤷

* Fix additional checkout fields test

* Add a waitForRequest safety check in case it's debounced

* Fix price filter test

* Fix flaky visitTemplateEditor util

* Remove obsolete code from global setup

* Revert "Fix flaky visitTemplateEditor util"

This reverts commit 227336f265.

* update to WordPress RC3

* Add waitForCustomerDataUpdate function

* Don't wait for requests and use data store instead

* Try with new wait condition

* Re-add wait condition

* Wait for customer update in guest checkout test

* Add changelog

* fix lint error

* fix some E2E tests

* disable welcome guide

* remove beforeAll

* add timeout

* add another timeout

* increase timeout

* Add call to waitForSiteEditorFinishLoading when editing the theme template

* remove timeout

* remove not necessary comment

* clean changelog

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

* remove changelog

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2024-03-27 10:54:44 +01:00
Tom Cafferkey 0cb3b4a9ad
Block Hooks API: Add CustomerAccount block to header (#43267)
Co-authored-by: github-actions <github-actions@github.com>
2024-03-26 08:38:06 +00:00
Thomas Roberts c1d644dc16
Try fixing additional checkout fields E2E test (#45789)
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
2024-03-25 03:56:55 -07:00
Seghir Nadir 401737994f
Use state name in Checkout block address card (#45799)
* Use state name in address card

* fix linting issue

* remove extra check for checkout endpoint

* address review feedback
2024-03-22 15:14:14 +01:00
Roy Ho 5aac82b0fe
Consolidate and move password protected product test (#45752)
* Consolidate and move password protected product test

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

* Move test to non side effect and remove remaining empty test file

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-21 07:44:30 -07:00
Karol Manijak 6cb52c00c0
Product Collection: add e2e tests with all product elements included (#45623)
* Prepare test cases

* Shorten out the test description

* Add first test in a post with dummy expect

* Verify all content is displayed

* Add the test in Product Archive and Home Page

* Add changelog

* Add tag to Beanie product

* Switch to Beanie which is on sale to verify on sale badge

* Add comments to explain the expects

* Adjust the expected content

* Switch to lower case in expect

* Switch from woocommerce/product-summary to core/post-excerpt

* Adjust products.sh

* Improve method waiting for products to show so it;'s deterministic

* Refresh locators in template

* Remove unnecessary check

* Eslint disable: expects are extracted to function so disable eslint compaining there's no expect

* Adjust other test after amending products setup

* Change the verify happening in a wrong place

* Tests adjustments

* Revert Blog Home template before performing a test

* Fix other tests
2024-03-19 08:59:58 +01:00
Bart Kalisz 1c1dc10958
Blocks E2E: Fix guest user handling in checkout tests (#45624) 2024-03-15 17:23:19 +00:00
Thomas Roberts 5cbb0ad5bf
[Experimental] Add E2E tests for Additional Checkout Fields (#43836)
* Add additional-checkout-fields-test-helper wp-env plugin

* Ensure Checkout page waits for email to be visible before filling

* Handle additional fields in checkout page utils

* Add test for filling additional checkout fields

* Add additional check for gov-id validation

* Close context used for plugin-checking

* Update types for additional fields to be key/value objects

* Check billing gov-id is different to shipping one

* Move additional fields plugin to inline with checkout tests

* Use additional fields plugin from local dir

* Await email input to check Checkout block is loaded

* Add test to verify error message shows when leaving a field blank

* Update comment

* Add test for checking/unchecking checkboxes

* Update check in additional field test plugin

* Change fields multiple times in one test

* Add server-side validation tests

* Get exact matches for checkout form fields

* Remove unnecessarily translated strings

* update hook in test plugin to compare to confirmation gov id

* Fill in gov ID confirmation field

* Register a field of each type in each location

* Don't validate field unless both are filled

* Fill additional fields and check their values

* Fill additional fields

* Check select values in order confirmation

* Change the values of all field types multiple times

* Make checkout wait until not calculating before submitting

* Update tests to use all additional field types

* Blur after editing select box

* Add customer area checks

* Check shipping isn't calculating before submitting

* Add merchant-side tests for additional checkout fields

* Ensure customer data is done updating before submitting

* use waitForFunction to check for updating shipping

* Add changelog

* Ensure fields are blurred before pressing button

* Update validation error check

* Add test for logged out shopper

* make specific function to wait for checkout to be finished updating

* Add test to ensure fields are saved across orders

* Add sanitize and validate callbacks to gov id fields

* Make purchase type select field required

* Add sanitization test

* Use experimental function in test plugin

* Add standalone sanitization filter test

* Update testing plugin to use new and renamed filters

* Fix typo

* Move empty value test to logged out shopper block and check empty val

* Update tests to include tests for new validation/sanitization filters

* Add verifyAdditionalFieldsDetails function to checkout page

* Use new verifyAdditionalFieldsDetails function to improve readability

* Update second test to use new function to improve readability

* Update third test to improve readability

* Update fourth function to improve readability

* Update fourth test to improve readability

* Update guest shopper test to be more readable

* Update helper function to only return value not assert

* Remove check causing test to fail in CI

* Make check for guest shopper same as logged in

* Move guest shopper tests to their own file

* Ensure unchecking checkbox works OK
2024-03-14 13:39:30 +01:00
Niels Lange a7383579be
Allow usage of block notice templates when using classic themes (#45164)
* Allow block notice templates in classic themes

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

* Fix e2e constants file

* Improve inline comments

* Add filter and enhance e2e tests

* Adjust test names

* Adress PHP lint errors

* Adress PHP lint errors

* Adress PHP lint errors

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-14 19:33:33 +07:00
Sam Seay 4cd89e4beb
Blocks Playwright tests: Add tests for the new attribute filter block (#45333) 2024-03-13 00:15:05 +13:00
Karol Manijak a3811fa007
Product Collection: Set initial value of Created filter for New Arrivals collection (#45355)
* Set initial vlaue of Created filter for New Arrivals collection

* Add changelog

* Remove a check for products in tests as they may not really be displayed

* Adjust the New Arrivals test

* Adjust the tests logic after the change

* Bring back previous formatting

* Bring back function closure removed by mistake
2024-03-08 08:33:21 +01:00
Niels Lange ba85f36219
Unskip Mini Cart i18n test (#45371)
* Unskip Mini Cart i18n test

* Install language packs before each i18n-related test suite

* Delete translations.sh

* Add changelog

* Replace deprecated WP-CLI command

* Remove obsolete WP-CLI command
2024-03-08 12:39:22 +07:00
Bart Kalisz 8ff89fa6db
Blocks E2E: Do not report slow tests (#45375) 2024-03-07 12:57:48 +01:00
Luigi Teschio 26c19fa1f8
Revert "[e2e tests blocks] Configure the number of shards for each ma… (#45324)
* Revert "[e2e tests blocks] Configure the number of shards for each matrix project (#45212)"

This reverts commit 72789656cf.

* trigger CI

* run E2E tests

* restore ci.yml file

* trigger E2E tests

* disable E2E tests about mini cart translations

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

* Fix the setupAndFetchQueryContextURL utility

* add comment

* Remove obsolete test

* Blocks E2E: Update timeout values (#45353)

Set timeout values same as core

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>
2024-03-06 16:52:37 +00:00
Sam Seay 49dbebfd0f
Refactor review blocks e2e tests to remove redundant html templates and add more scenarios (#44880) 2024-02-29 15:43:59 +13:00
Niels Lange a668cf942e
Add e2e tests for notice templates (#44612)
* Add e2e tests for notice templates

* Add changelog entry

* Minor refactor

* Remove child theme zip files

* Generate child theme zip files on the fly
2024-02-27 13:46:31 +01:00
Bart Kalisz 8b4bacc2bf
[E2E] Refactor blocks global setup (#44843) 2024-02-23 11:17:46 +01:00
Bart Kalisz 045df6f3e7
[E2E] Stabilize Product Collection "on sale" tests (#44796) 2024-02-21 13:44:07 +01:00
Bart Kalisz b8d2136aa2
[E2E] Setup block theme without opening browser (#44702) 2024-02-20 16:52:53 +01:00
Bart Kalisz 82d1df5b37
[E2E] Stabilize a flaky Price Filter test (#44690) 2024-02-20 16:30:16 +01:00
Albert Juhé Lluveras 484398cfe1
Open templates from list instead of loading the URL in block templates e2e tests (#44774)
* Open templates from list instead of loading the URL in block templates e2e tests

* Typo

* Clean up

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

* Make sure correct template is loaded

* Create a TemplateType type to avoid having to define it in several places

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-20 10:35:27 +01:00
Karol Manijak 5b420159cb
Product Collection: disable "Sync with current query" option for 2nd+ block on archive (#44577)
* Refactor store usage

* Prepare function resolving inherit property for additional check

* Add logic to disable sync with query if there's already one Product Collection on archive that does that

* Add changelog

* Cover the post editor case

* Add E2E test for that and small refactor in tests

* Remove duplicated import

* Fix lint problems

* Fix typo in test description

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>

* Replace confusin abbreviation with other description

* Update the logic to be more robust and covering also the case where Product Collection blocks are nested

* Add issue reference to the comment

* Add eslint disable before ts-ignore

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2024-02-19 17:51:42 +01:00
Karol Manijak 76f6b0097e
Product Collection: Improve flaky E2E test (#44687)
* Remove unnecessary waitForResponse making a test flaky

* Add changelog
2024-02-19 09:08:11 +01:00
Bart Kalisz 711f420ef1
[E2E] Stabilize flaky Add to Cart test (#44639)
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
2024-02-16 13:44:41 +00:00
Tarun Vijwani 506499dec4
Prevent prefilling of the billing address with the shipping address in the Checkout block for the Guest Shopper (#44347)
* Clear billing address when useShippingAsBilling checkbox is unchecked

* Add billing address sync with server

* Add useRef hook to store previous billing address and update sync functions

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

* Revert "Add useRef hook to store previous billing address and update sync functions"

This reverts commit 7bc3312ab7.

* Added condition to clear address only for guest users

* Add E2E test to check billing address form is empty for Guest shopper

* Fix typo

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

* Updated docs-manifest.json

* Revert "Updated docs-manifest.json"

This reverts commit 20d578a9d6.

* Include company field in the E2E test

* Replace beforeAll with beforeEach

* Skip country reset to keep consistency with Shortcode Checkout

* Remove sync billing address on server

* Update E2E test to include the shipping address check

* Remove unsed  imports

* Clear address fields except country and state

* Optimize the billing and shipping address check with switch statement

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2024-02-16 16:10:51 +04:00
Sam Seay 5ecea1b8c2
Support testing many variants of a block at runtime via dynamically generated templates (#44223) 2024-02-17 01:00:36 +13:00
Jonathan Lane 2812adc5af
Add sharding to Blocks e2e tests (#44440)
* Add sharding to Blocks e2e tests

* Changelog

* Push a change to Blocks README to trigger tests

* Fix syntax

* Fixed again

* Try again

* Trying to get the shard number

* Shard names

* fix E2E test

* complete all the jobs

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2024-02-15 09:27:17 -08:00
Albert Juhé Lluveras dd56a3ba61
Clean up block templates after running e2e tests (#44600)
* Clean up block templates after running e2e tests

* Add changelog entry

* Fix linting
2024-02-15 08:17:12 +01:00
Bart Kalisz 2432b3b22e
[E2E] Update the blocks E2E setup guide (#44468)
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2024-02-14 16:00:52 +02:00
Karol Manijak 2750e79224
Getting the Product Collection location/context (#43997)
* Early implementation of getting the Product Collection location/context

* Solve the problem of async fetch in the hook

* Improve typing

* Import core data store instead of hardcoding store name

* Recognise Product Category and Product Tag

* Remove attr property from archive location data

* Unify states naming

* Add TODO entry

* Display the info about the location of Product Collection

* Improve the typing

* Recognise if Product Collection is nested in Single Product block

* Improve cases descriptions and add some defaults to potentially undefined values

* Change the taxonomies sourceData

* Recognise Mini Cart as Cart context

* Recognise attribute as archive contect but no taxonomy

* Refactor the function into single useEffect and clean it up

* Fix typo

* Remove unnecessary import

* Stop rendering the output in Editor (it was for demo purposes)

* Pass location data to Product Template query in Editor

* Replace templateSlugs literal strings with object reference

* Rename parseResponse function to more specific name getIdFromResponse

* Add dpeendency array to useEffect

* Refactor templates detection

* Use full taxonomy names instead of shortcuts

* Write down scenarios to test

* Working scenario

* Change the verification way for more robust

* Add more robust methods to include Single Product block

* Add test Product Collection in Single Product block in a Single Product Template

* Imprvoe the order of veryfing the requests

* Fix linter issues. Although that makes code less readable

* Improve the useGetLocation typing so it's more generic

* Rework the E2E tests regarding location of Product Collection and limit their number

* Bring back necessary eslint-disable

* Remove unused imports

* Uncomment line required for other tests

* Add changelog

* Rename constant from BLOCK_NAME to BLOCK_SLUG as it's a slug

* Add a BLOCK_NAME constant and replace the literal block name usages in E2E tests

* Fix post merge issues

* Fix test after merge

* Adjust the tests to kick off waiting for request before action that triggers them
2024-02-12 20:59:40 +01:00
Karol Manijak cc0d7368e9
Add missing Beta label to Product Filters E2E tests (#44564)
* Add missing Beta label to Product Filters E2E tests

* Add changelog
2024-02-12 20:26:19 +01:00
Manish Menaria 4ae60196ea
Product Collection: Make attributes available in rest_product_query hook (#44150)
* Make attributes available in rest_product_query hook

This commit introduces the 'includeInQueryContext' attribute to the 'woocommerce/product-collection' block and updates the 'woocommerce/product-template' block to consume this new attribute.

Key Changes:
1. `woocommerce/product-collection` Block:
   - A new attribute 'includeInQueryContext' is added in `block.json`. This attribute is designed to hold a list of attribute names relevant for the query context.
   - The 'includeInQueryContext' attribute is included in the `providesContext` field to ensure its availability to child blocks.
   - In `constants.ts`, default values for 'includeInQueryContext' are defined, specifying 'collection' and 'id' as initial attributes.
   - The `types.ts` file is updated with a comment explaining the purpose of 'includeInQueryContext'.

2. `woocommerce/product-template` Block:
   - Modified `block.json` to utilize the 'includeInQueryContext' context provided by the parent `woocommerce/product-collection` block.
   - The `edit.tsx` file is updated to handle the new context. It uses a newly added utility function `useProductCollectionBlockAttributes` from `utils.tsx` to access parent block attributes.
   - The `utils.tsx` file is introduced, containing the `useProductCollectionBlockAttributes` hook. This hook is responsible for finding the parent 'woocommerce/product-collection' block and returning its attributes.
   - Within `edit.tsx`, logic is added to create a query context object based on the attributes specified in 'includeInQueryContext', enhancing the block's ability to dynamically adapt to changes.

* Remove commented code

* Rename query context attribute and optimize parent block detection

This commit introduces two significant changes aimed at improving code readability and efficiency.

1. **Renaming of Query Context Attribute:**
   - The attribute `includeInQueryContext` has been renamed to `queryContextIncludes` across various files, including block JSON configurations and TypeScript definitions. This change makes the attribute's purpose more intuitive, indicating it specifies which attributes to include in the query context.

2. **Optimized Parent Block Detection:**
   - Replaced the use of `getBlockParents` with `getBlockParentsByBlockName` in utility functions to find the closest Product Collection block. This optimization allows for a more direct and efficient way to identify the relevant parent block by specifying the block name, reducing unnecessary iterations and improving code performance.

* Streamline query context construction in product template

Key Changes:
- **Introduction of `useProductCollectionQueryContext` Hook:** This new hook takes the `clientId` and `queryContextIncludes` as inputs and returns a query context object. It encapsulates the logic for fetching parent product collection block attributes and constructing the query context accordingly. This abstraction simplifies the edit component's logic, focusing on the essentials and improving code readability.
- **Optimization of Parent Block Detection:** The hook uses `getBlockParentsByBlockName` to accurately and efficiently find the closest parent `Product Collection` block, minimizing the overhead previously associated with traversing the block hierarchy.

* Always include `collection` and `id` in query context

* Minor refactor

* Enhance query context handling for more maintainable code

- Introduced `DEFAULT_QUERY_CONTEXT_ATTRIBUTES` in `edit.tsx` to maintain a clear list of default query context attributes.
- Modified `ProductTemplateEdit` to automatically include these default attributes in `queryContextIncludes`, ensuring they are always part of the query context without manual initialization.
- Simplified `useProductCollectionQueryContext` in `utils.tsx` by removing static initialization of 'collection' and 'id', relying instead on the dynamic addition of necessary attributes from `queryContextIncludes`.

This refactor enhances the maintainability and clarity of the code, ensuring a solid foundation for future enhancements and features.

* Add E2E tests for Product Collection query context

- Added a new test suite 'Query Context in Editor' to validate the correctness of query context parameters when the Product Collection block is used. This suite ensures that:
  - For the 'Product Catalog', only the ID is sent in the query context, confirming that collection-specific parameters are excluded when not relevant.
  - For collections such as 'On Sale', the collection name is correctly passed in the query context, validating that the block dynamically adjusts query parameters based on its settings.

- Introduced a new utility method `setupAndFetchQueryContextURL` in `product-collection.page.ts`. This method automates the setup of a post with the Product Collection block and fetches the URL with query context parameters, facilitating the validation of query context handling.

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

* Fix edge case when `queryContextIncludes` is not defined

- Initializing `queryContextIncludes` with a default empty array directly in the destructuring assignment of the component's props. This approach ensures that `queryContextIncludes` is always an array, simplifying downstream logic.
- Creating a new constant `queryContextIncludesWithDefaults` to hold the combination of `queryContextIncludes` and `DEFAULT_QUERY_CONTEXT_ATTRIBUTES`. This step avoids directly mutating the `queryContextIncludes` prop, aligning with best practices for functional purity and making the code easier to understand and debug.
- Updating the `useProductCollectionQueryContext` hook call to use `queryContextIncludesWithDefaults`. This ensures that the default query context attributes are consistently included without altering the original prop.

These adjustments not only enhance the code's maintainability but also ensure more predictable behavior by avoiding side effects related to parameter mutation.

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-12 14:15:24 +05:30
Karol Manijak 96f3e3c98b
Remove global pageObject action from Product Collection tests and add it as before each for specific tests (#44407)
* Remove global pageObject action from Product Collection tests and add it as before all for specific tests

* Replace beforeAll with beforeEach

* Adjust the beforeEach usage

* Add changelog

* Refresh locators when adding Single Product block as it's not initialised in pageObject

* Change method dedicated to templates to one dedicated to posts
2024-02-12 09:44:02 +01:00
Albert Juhé Lluveras 2f5eaa1f4c
BlockTemplateUtils cleanup (#44256)
* Remove 'get_block_template' backwards compatibility check

* Add back get_block_template as a deprecated function

* Deprecate BlockTemplateUtils::filter_block_templates_by_feature_flag()

* Replace 'default template' with 'fallback template'

* Only load BlockTemplatesController in block themes

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

* Remove unnecessary WP version comparison

* Revert "Only load BlockTemplatesController in block themes"

This reverts commit 8e1ed347d61b7ae5e8b8b96fa73b410565570f01.

* Remove deprecated functions, as they are marked as internal

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-09 18:50:08 +01:00
Alexandre Lara 74c6fcad2d
Product Gallery block > Pop-Up: Fix overlay sizing issue (#44479)
* Fix overlay issue when Product Gallery Pop-Up is open

* Fix stylelint error

* Add changelog

* Fix e2e tests for Product Gallery Pop-Up
2024-02-09 11:38:41 -03:00
Albert Juhé Lluveras 1905534fb8
Improve password-protected Single Product block template to verify correct template is displayed after correct password is introduced (#44452)
* Improve password-protected Single Product block template to verify correct template is displayed after correct password is introduced

* Add changelog entry
2024-02-09 10:53:27 +01:00
Albert Juhé Lluveras f65a7e45a5
Fix e2e tests due to duplicate rows when clearing customizations (#44454)
* Fix e2e tests due to duplicate rows when clearing customizations

* Add changelog entry
2024-02-08 23:15:11 +01:00
Albert Juhé Lluveras e0f4ed8509
Add automated tests to verify specific product block templates are rendered (#44363)
* Add automated tests to verify specific product templates are rendered

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-08 10:18:33 +01:00
Karol Manijak 67dda736d4
Improve flaky Product Collection E2E test when nested in Single Product block (#44404)
* Improve Product Collection test when nested in Single Product block, previous version was flakyu

* Add changelog

* Move the priovate method below the comment starting private methods

* Remove unnecessary wait
2024-02-07 07:53:48 +01:00
Albert Juhé Lluveras fa9d42be4f
Add template title and description on 'get_block_template' hook (#44254)
* Simplify add template title and description

* Add template title and description on 'get_block_template' hook. Fixes #42221

* Add tests

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

* Fix test in template parts

* Use BlockTemplateUtils::template_has_title when possible

* Add test also when saving the default WooCommerce template

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-06 13:33:38 +01:00
Sam Seay 5f00e2f87a
[Experimental] Add e2e tests for the rating filter block (#44192) 2024-02-06 23:22:21 +13:00
Alexandre Lara 560f0e933d
Product Gallery block: Prevent block error when a user inputs a decimal number for the Number of Thumbnails setting (#44282)
* fix error on decimal input for the Number of Thumbnails setting

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-05 15:17:35 -03:00
Albert Juhé Lluveras 097bd5c8f5
Add e2e tests for password-protected Single Product block template (#44304)
* Add e2e tests for password-protected Single Product block template

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

* Fix tests

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-05 10:47:18 +01:00
Sam Seay 497d4b8a25
Remove class scoping and just use text to find elements (#44289) 2024-02-05 14:27:54 +13:00
Sam Seay 6da45f6bed
[Experimental] Add e2e tests for the new active filter block (#44190) 2024-02-02 15:08:01 +13:00
Karol Manijak 84f2de633d
Fix incorrect product data displayed in Product Collection in context of Single Product block (#44123)
* Initial approach to fix incorrect product data displayed in Product Collection in context of Single Product block

* Remove the BlockCOntextProvider

* Add Block context for title and summary

* Add changelog

* Improve typing

* Add E2E test with Product Collection inside Single Product block

* Improve insertBLock function description

* Make productPrices selector in Product Collectionmore specific

* Extract components props into a types
2024-02-01 17:55:38 +01:00
Albert Juhé Lluveras d936e4afee
Merge Checkout Header and Mini-Cart template parts tests into parameterized test files (#44176)
* Rename block template customization test files

* Move Checkout Header template part tests to parameterized tests

* Make it so 'userText' in tests is different in each template, so prevent false positives

* Move Mini-Cart template part tests to parameterized tests

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

* Make sure there are products in cart before going to the Checkout template

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-01 11:43:33 +01:00
Karol Manijak a164c8afa9
Fix CI Lint errors (#44228)
* Fix linter issues

* Add changelog
2024-01-31 16:12:30 +01:00
Niels Lange c704ae2cab
Migrate coupon- and shipping-related tests to Playwright (#44108)
* Migrate coupon- and shipping-related tests

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

* Fix prettier issue

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-31 01:23:09 -08:00
Albert Juhé Lluveras 3df7da4bd2
Add theme-customization e2e tests to Cart, Checkout and Order Confirmation templates (#43794)
* Add theme-customization e2e tests to Cart and Checkout templates

* Add theme-customization e2e tests to Order Confirmation template

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

* Update after rebase

* Make it so Order Confirmation template tests are also part of the parameterized tests

* Use CUSTOMIZABLE_WC_TEMPLATES constant instead of defining the templates again

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

* Fix wrong template slug

* Rename 'default' to 'fallback' template

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-30 09:44:42 +01:00
Albert Juhé Lluveras 7f735714a4
Add e2e tests for the Page Content Wrapper block (#44122)
* Add Page Content Wrapper e2e tests

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-29 10:11:43 +01:00
Albert Juhé Lluveras 66c3467b69
Avoid duplicate templates appearing on the Site Editor when the WooCommerce template and the theme template have been customized by the user (#44000)
* Avoid duplicate templates appearing on the Site Editor when the WooCommerce template and the theme template have been customized by the user

* Add tests

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

* Clean up templates after running all tests to increase speed

* Fix comment linting

* Fix addToCart() util with the classic template

* Remove unnecessary condition

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-25 14:55:17 +01:00
Albert Juhé Lluveras 081f9d303b
Move Cart, Checkout and Order Confirmation template customization tests to the parameterized tests file (#43992)
* Move Cart, Checkout and Order Confirmation template customization tests to the parameterized tests file

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

* Clean up order-confirmation.block_theme.spec.ts file

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-24 15:26:07 +01:00
jonathansadowski 9b98a85380
Remove docs plugin from monorepo (#44013)
* Remove docs plugin from monorepo

* Add language to md-docs readme

* Fix lint error in blocks

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-23 16:16:07 -06:00
Niels Lange 30dfa013f9
Unskip e2e tests (#43852)
* Remove obsolete comment

* Unskip cart and checkout translation tests

* Unskip shipping method switching tests

* Unskip template-related e2e tests

* Unskip order confirmation test for guest users

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

* Adjust broken e2e tests

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-23 21:32:10 +07:00
Sam Seay 42e77d4938
[Experimental] Product Filter - Reintroduce Wrapper Block (#43688) 2024-01-23 18:29:24 +13:00
Albert Juhé Lluveras c1b131c869
Add e2e tests to verify specific theme templates have priority over user-modified Product Catalog template (#43750)
* Add e2e tests to verify specific theme templates have priority over user-modified Product Catalog template

* Add changefile(s) from automation for the following project(s): woocommerce-blocks
2024-01-22 14:44:07 +01:00
Albert Juhé Lluveras 550bfe3572
Update WC Blocks Playwright tests docs so we pass parameters correctly to PNPM scripts (#43779) 2024-01-22 11:20:59 +01:00
Niels Lange 7cd04dfa5a
Add e2e test to hover Mini Cart totals (#43693)
* Add e2e test to hover Mini Cart totals

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

* Optimise hover test

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 20:06:28 +07:00
Albert Juhé Lluveras 91d0e16151
Convert block templates tests to parametized tests (#43778)
* Convert block templates tests to parametized tests

* Use frontendUtils.addToCart() when possible

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 13:29:07 +01:00
Albert Juhé Lluveras 6c3f8cb6fb
Add e2e tests to verify block templates can be customized if the theme has its own custom templates (#43650)
* Update commands to run e2e tests

* Capitalize Product Catalog template name

* Create tests with block theme with templates

* Create Block Theme with Templates test environment

* Update classic theme commands

* Code cleanup

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

* Code cleanup (II)

* Add config to blocks-playwright.yml and remove unnecesssary .github/workflows/playwright.yml file

* Remove unnecessary imports from product-catalog-template.block_theme_with_templates.spec.ts

* Update blocks e2e commands to pnpm

* Replace hardcoded strings with a variable

* Unify all 'block theme with templates' tests in a parameterized test

* Create a testData object for the Mini-Cart template part test

* Fix some code styling issues

* Create a testData object for the Mini-Cart template part test (II)

* Remove duplicate userText variable

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 11:39:24 +01:00
Karol Manijak 1dd23f8eeb
Product Collection: add E2E tests to Editor filters - by featured products, by created date, by price range (#43473)
* Add test to Product Collection - featured products filters

* Open Featured option before trying to set it up

* Add test for Created filter

* Add missing awaits

* Add tests for a price range filter

* Add explanation to test step

* Update the conditions for created filter

* Add changelog

* Change leftover values

* Empty commit - trigger CI
2024-01-16 20:59:27 +01:00
Karol Manijak c531067daf
Improve the selector determining the products are loaded in Product Collection tests (#43464)
* Improve the selector determining the products are loaded in Product Collection tests

* Add changelog

* Update plugins/woocommerce/changelog/test-42038-make-product-collection-e2e-tests-more-robust

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2024-01-16 08:31:22 +01:00
Niels Lange 9779f0a022
Migrate mini cart tests (#43549)
* Migrate mini cart tests

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

* Adjust broken e2e test

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-16 13:58:54 +07:00
Tarun Vijwani d329ced1e8
E2E tests migration: performance -> cart (#42943)
* Add Performance Util class to evaluate performance

* Add performance logging in cart block test

* Remove additional comments

* Migrate Cart  E2E performance tests to Playwright

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

* Refactor performance calculations in PerformanceUtils page

* Fix linting errors

* Replace beforeAll with beforeEach

* Fix directory creation in performance-utils.page.ts

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2024-01-15 21:03:24 +04:00
Karol Manijak 2c628a2938
Product Collection: add E2E tests to Editor filters - by tag and by stock status (#43548)
* Add test to check Product Collection filtering by tags

* Set single product out of stock and unskip the test for stock status

* Add changelog

* Use more specific selector

* Update variables holding products in products.sh to keep the same convention
2024-01-15 11:25:49 +01:00
Paulo Arromba 99e825df1f
Migrate merchant local-pickup e2e tests to Playwright (#43057)
* Playwright migrated test file bootstrap and first test for local pickup

* Added page reload to force a new render

* Updated test description

* WIP: figuring out the fake input checkbox

* WIP: figuring out flaky state of local pickup enabled

* Fix flakey enable/disable local pickup

* Migrated remaining local pickup tests to Playwright

* Removed deprecated E2E

* Added changelog

* Corrected linting errors

* Fixed playwright/no-element-handle lint error

* Replace CSS IDs and classes with recommended built in locators

* Remove obsolete function calls

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2024-01-11 21:25:12 +07:00
Albert Juhé Lluveras 67fb8d7511
Add e2e tests to verify Products by Category/Tag/Attribute templates default to Product Catalog template (#43471)
* Add e2e tests to verify Products by Category/Tag/Attribute templates default to Product Catalog template

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-11 12:47:56 +01:00
Sam Seay 5fdbe63530
[Experimental] Rename Collection Filters to Product Filters (#43363)
---------
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2024-01-12 00:27:33 +13:00
Albert Juhé Lluveras 6bc865dd9b
Add e2e tests for user customization of block templates (#43426)
* Add e2e tests for user customization of block templates

* Update instructions to run Playwright e2e tests

* Code cleanup

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

* Create revertTemplateCustomizations util

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-10 16:51:53 +01:00
Thomas Roberts d8331dc3f1
Add additional information block for custom checkout fields (#43274)
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-01-10 06:20:06 -08:00
Tung Du 8fb3d394a5
[Experimental] Add basic e2e test for new filter blocks (#43392) 2024-01-10 18:17:00 +07:00
Alexandre Lara 65d9c6764c
[Experimental] Product Gallery block: Rename media setting to "Open pop-up when clicked" (#43302)
* Rename media setting to "Open pop-up when clicked"

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-08 16:58:27 -03:00
Luigi Teschio 3978be9fdd
fix - Product Button: don't trigger jQuery add to cart function when the button is clicked on classic themes (#43325)
* fix - Product Button: don't trigger old add to cart function when the button is clicked on classic themes

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

* improve E2E tests

* update changelog

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

* update changelog

* use beforeEach

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-01-05 17:34:16 +01:00
Saad Tarhi 009ff8707b
Move shopper-side Cart E2E tests to Playwright (#42897)
* Convert empty cart E2E test

* Convert product removal E2E test

* Convert quantity update E2E test to Playwright

* Convert E2E tests of the remaining methods that update cart quantity

* Convert E2E test: Proceed to Checkout

* Convert E2E test: Cross-Sells

* Remove test files

* Update plugins/woocommerce-blocks/tests/e2e/tests/cart/cart-block.shopper.block_theme.side_effects.spec.ts

Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>

* Set up cross sells products before e2e test

* Solve merge conflict

* Add changelog entry

* Remove obsolete import

---------

Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
2024-01-05 17:15:23 +07:00
Alexandre Lara bffe12b945
Product Gallery block: Fix e2e tests for Thumbnails block (#43060)
* Fix e2e tests for thumbnails change

* Add changelog
2024-01-04 10:38:32 -03:00
Alexandre Lara 44e4a75419
[E2E Tests] Product Gallery > Thumbnails block: Refactor code to remove unnecessary wait for timeout (#43180)
* Refactor code to remove unnecessary wait for timeout

* Add changelog
2024-01-02 16:29:37 -03:00
Alexandre Lara e968c329c6
Add e2e tests for image transition in Product Gallery block (#43095)
* Add e2e tests for image transition in Product Gallery block

* Create e2e tests for the Product Gallery block when it is inside the pop-up

* Add changelog

* Remove unnecessary lodash dependency import
2024-01-02 16:19:28 -03:00
Manish Menaria 5d5fc57e8c
Fix: migration issues when transitioning from Products (Beta) block to Product Collection block (#43130)
* Update product query block templates with WooCommerce namespace

It modifies the `<wp:post-template>` block in multiple files to include a new attribute: `{"__woocommerceNamespace":"woocommerce/product-query/product-template"}`.

The inclusion of the `__woocommerceNamespace` attribute is a strategic enhancement, ensuring that these block templates are explicitly recognized as part of the WooCommerce namespace.
This fix the issue where migration from Products beta block to Product Collection block doesn't work properly.

* Fix linting error

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-29 12:09:12 +05:30
Tarun Vijwani 2749cebf7f
E2E tests migration: Backend mini-cart tests to Playwright (#43093)
* Migrate Backend mini-cart tests to Playwright

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-12-28 14:33:53 +04:00
Karol Manijak 37155abb0c
New flow of adding Product Collection and basic set of Collections (#42696)
* Migrate PR to Core

* Migrate test changes

* Add Custom Collection with inherit query attribute disabled

* Update copy of Product Catalog collection

* Don't choose default active collection in polaceholder and remove highlight

* Remove inherit query option from inspector controls

* Add collection names to Product Catalog and Custom one

* Unify Collection Chooser between Modal and Placeholder

* Bring back util removed by accident

* Replace the translations domain with woocommerce

* Remove leftovers after merge

* Add pagination and no results to Product Catalog and Custom collections

* Revert textdomain change

* Fix lint error

* Add changelog entry

* Change collection label

* Bring back Inherit query from template

* Remove Custom collection and bring back single Product Collection

* Simplify applying collection

* Make sure Inherit query from template is enabled in archive templates by default and disbaled in posts/pages

* Change incorrect Playwright locator

* Add test for Product Catalog inheriting the query in product archive

* Add tests for recommendation collection hiding the predefined filters

* Add reviews to multiple products

* Update expected products in Top Rated

* Remove rating creation in test env and skip undeterministic tests

* Add skip to Best Sellers test

* Update README.md

* Add more keywords to collections, like 'product collection' to recommendation collections

* Rephrase the README note about Collections registration

* Simplify types

* Rename unchangeableFilters to hideControls

* Fix typo in file name

* Remove 'pattern' references from toolbar files

* Replace hardcoded SCSS color with wc variable

* Remove changelog file from different PR

* Move hideControls to Product Collection ayttributes

* Improve responsiveness of columns in Product Collection Placeholder

* Use admin color pallette in Product Collection Placeholder

* Move Inherit query from template to the top of Inspector Controls

* Change the Collection prefix to woocommerce rather than woocommerce-blocks

* Simplify Placeholder and Modal styles
2023-12-27 11:07:27 +01:00
Albert Juhé Lluveras 2da7b73e76
Add Playwright tests for All Reviews, Reviews by Product and Reviews by Category blocks (#42903)
* Remove Reviews blocks Puppeteer tests

* Minor code cleanup

* Typos

* Create publishAndVisitPost() editor util

* Fix subcategories when importing products in Playwright and add reviews

* Add Reviews blocks tests in Playwright

* More typos

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

* Create a 'reviews' object in data.ts so we can store reviews data in one single place

* Update test so instead of creating a new post in each test, we go to the already-created post

* Add source comments to reviews data to match it with the script

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-22 09:33:18 +01:00
Jonathan Lane 1bf35ac737
Playwright test workflow migration from Blocks repo (#42804)
* First pass at Playwright test migration

* Set working directory

* Remove exec

* Configure the environment before testing

* Remove filter

* Update paths for tests

* Try explicitly stating working-directory

* Change tests directory

* Try running all tests

* Uncommented project

* Update commands to run tests

* Comment out env config

* Uncomment

* Changelog

* Set up multiple test configurations

* Update failing test

* Update paths for artifacts

* Update path to artifacts

* Path to results

* remove unnecessary file

* Skip translation E2E tests

Skipping translation tests until we fix the missing translations issues after we changed the domain to "woocommerce"

* Update the artifacts path

* Fix lint errors

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2023-12-15 09:34:29 -08:00
Seghir Nadir 12572ce08c
Introduce Additional Fields extensibility API (#42695)
* Introduce Additional Fields API for Checkout Block https://github.com/woocommerce/woocommerce-blocks/pull/12073

* add changelog

* Auto load the Blocks/Domain/Services/functions.php file

* add changelog

* revert test to what it was

* Update text domain for translations

* Ensure address data is added on the cart block too

* fix lint problem

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2023-12-15 13:45:38 +01:00
Jonathan Lane 8e2e7de7ce
Migrate Puppeteer test action from Blocks repo (#42733)
* Migrate Puppeteer test action from Blocks repo

* Update file path

* Use pnpm

* Use npm

* Updates based on feedback

* Comment out paths for testing

* Fix paths with working directory

* Use pnpm

* Fix missing pnpms

* npm instead

* Do use pnpm

* Update command

* Blocks wp-env config

* Update paths, config files

* Run test commands from blocks

* Config update

* Uncomment paths so that e2e checks only run on Blocks

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2023-12-13 16:01:34 -08:00
Christopher Allford ec9b7852f9
Fixed Blocks Linting Errors (#42727) 2023-12-12 15:05:20 -08:00
Christopher Allford 389828ad7e Fixed Blocks Autoloads 2023-12-09 20:42:32 -08:00
Christopher Allford ac25f674e6 Moved Blocks PHPUnit Tests 2023-12-09 05:35:16 -08:00
Saad Tarhi 33978990a5 Move shopper-side Checkout E2E tests to Playwright (https://github.com/woocommerce/woocommerce-blocks/pull/11998)
* convert first local pickup test

* Convert the second local pickup test

This test detected a bug. We will skip it for now and create a ticket to fix it!

* Remove old local pickup E2E tests

* Convert Payment Methods E2E tests

* Remove old payment methods tests

* Convert shipping/billing E2E tests

* Remove old shipping/billing E2E tests

* Add some line breaks for a better readability

* Update tests/e2e/tests/checkout/checkout-block.shopper.block_theme.side_effects.spec.ts

Co-authored-by: Niels Lange <info@nielslange.de>

* Fix ESLint errors

* Move E2E tests to the Checkout shopper file

* Fix ESLint error

* Convert Checkout Error Forms E2E tests

* Use guest user instead of logged in customer for Checkout Errors E2E tests

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2023-12-08 21:35:53 +01:00
Saad Tarhi 417683095a Playwright E2E tests: Multiple signed in roles (https://github.com/woocommerce/woocommerce-blocks/pull/10561)
* Convert checkout place order E2E tests to Playwright

* Add "gotoMyAccount" method

* Create login/logout utility functions

* Use the existing "customer" test data

* Complete the place order test cases

* Fix "My Account" page title

* Fix rebase

* Reset My account page title

* Check for heading instead of the page title

* Check for heading in login/logout functions

* Fix all failing tests

* Add guest/customer/admin roles

* Update the auth setup

* Register the auth setup within Playwright

* Update testing cases

* Add generated auth files to .gitignore

* Tidy up comments

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Remove unnecessary comment

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Update comments

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Remove unnecessary comment

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Update comment for Guest case

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Remove confusing comment

* Remove another unnecessary comment

* Remove unnecessary Playwright project dependency

* Tidy up the file structure and constants

* Fix mixed up test descriptions

* Remove commented code

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Remove unnecessary function from frontend-utils

* Refactor testing cases

* Rename testing file

* Delete unused testing file

* Ensure we're logged out before trying to log in as a user

* Log out before each authentication setup step

* Ensure tests requiring admin are logged in

* Log in as admin during block theme setup

* Fix Playwright strict mode violation

* Run Multiple sign-in roles to the global-setup phase

In this step of the Playwright's setup, we can add the multiple sign-in
roles and keeping the admin logged by default.
This fixes the issue of failing tests `logged out` error.

* Remove unnecessary login as admin

* Remove "auth.setup" dependency since the logic lives in the global setup instead

* Remove unnecessary login as admin from test files

The admin profile is set by default

---------

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2023-12-08 17:44:59 +01:00
Thomas Roberts 906961be3b Move merchant-side Checkout E2E tests to Playwright (https://github.com/woocommerce/woocommerce-blocks/pull/11853) 2023-12-07 17:32:18 +00:00
Niels Lange 7a0835e354 Migrate translation tests to Playwright (https://github.com/woocommerce/woocommerce-blocks/pull/12070)
* Migrate translation tests to Playwright

* Optimise tests

* Migrate translation tests to Playwright

* Optimise tests

* Run test as side effects
2023-12-07 16:50:00 +00:00
Luigi Teschio 88562d1106 Products By Attribute: E2E tests - skip test (https://github.com/woocommerce/woocommerce-blocks/pull/12085) 2023-12-07 17:19:50 +01:00
Darren Ethier 795f008952 Implement the Block Hooks API to automatically inject the Mini-Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/11745)
* Change the default for Mini Cart block

The Block Hooks API currently doesn’t allow for setting the default state of the block injected into content so this ensures the mini-cart block has a better default state for injection. The current default (displaying total value in cart) takes up more width increasing the risk of poor layout.

* Utilize Block Hooks to automatically inject mini-cart block.

* include experimental prefix on filters

* Fix filter name.

* remove experimental prefix.

On thinking about this, I don’t think these need to be experimental. They are intentionally provided as escape hatches for hosts/themes that want to opt-in/out so we’ll have to support them when this is shipped (at least until its no longer needed!)

* fix variable name!

* fix unit tests because of new default

* remove another incorrect text expectation

Defaults for the block affect this expectation.

* fix E2E tests

* Mini Cart Block: improve E2E test

* fix: improve check for the Product Collection block

---------

Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2023-12-04 17:27:27 +01:00
Luigi Teschio af23649365 Hook `woocommerce_single_product_summary` action to `core/post-excerpt` block (https://github.com/woocommerce/woocommerce-blocks/pull/11953)
* hook woocommerce_single_product_summary into core/post-excerpt block

* Add E2E tests

* improve E2E test
2023-12-04 09:03:00 +01:00
Thomas Roberts 66cc2bd9e8 Move checkout terms & conditions/privacy policy tests (https://github.com/woocommerce/woocommerce-blocks/pull/11973) 2023-11-29 04:16:44 -08:00
Thomas Roberts a652fa18f8 Move the Checkout -> Account tests from puppeteer to Playwright (https://github.com/woocommerce/woocommerce-blocks/pull/11961) 2023-11-28 23:16:25 +04:00
Thomas Roberts d32be3f47b Migrate cart/checkout tax tests to Playwright (https://github.com/woocommerce/woocommerce-blocks/pull/11954) 2023-11-28 21:00:40 +07:00
Karol Manijak 2ab440b806 Reorganise Columns controls and fix undefined problem in Product Collection settings (https://github.com/woocommerce/woocommerce-blocks/pull/11937)
* Reorganise Columns controls and fix undefined problem in Product Collection settings

* Remove type condition in hasValue of Columns control

* Adjust the E2E tests locator to new changes
2023-11-28 08:33:31 +01:00
Niels Lange 5f0c4726a8 Investigate E2E CI caching issue (https://github.com/woocommerce/woocommerce-blocks/pull/11874)
* Try env:restart instead of env:start

* Change env:restart to env:start again

* Try env:restart instead of env:start

* Change env:restart to env:start again

* Adjust heading level of cart and checkout template

* Replace button selector with label selector

* Try env:restart instead of env:start

* Change env:restart to env:start again

* Ensure to close welcome guide modal

* Adjust heading level of default template content

* Try env:restart instead of env:start

* Change env:restart to env:start again

* Try env:restart instead of env:start

* Change env:restart to env:start again

* Address existing TS issues

* View template in edit mode

* Keep certain tests skipped

* Fix broken tests after addressing TS issues
2023-11-28 14:16:45 +07:00
Manish Menaria 53944beeb3 [Product Collection] Fix: HTML entity decoding for product names in Hand-Picked Products (https://github.com/woocommerce/woocommerce-blocks/pull/11927)
* Add HTML entity decoding for product names in Hand-Picked Products control

In the Hand-Picked Products control within the product-collection inspector controls, a function for decoding HTML entities in product names has been added.

- A new utility function `decodeHTMLEntities` has been implemented. This function decodes HTML entities in a string, ensuring that special characters are correctly displayed in their human-readable form.
- The `transformTokenIntoProductName` function has been updated to utilize `decodeHTMLEntities`. Now, when a product name is fetched (either directly as a token or via a product ID), the HTML entities within the name are decoded.
- This enhancement ensures that product names containing characters like ampersands or other HTML entities are accurately displayed in the UI.

This change improves the readability and accuracy of product names within the Hand-Picked Products control, enhancing the user experience for store managers using WooCommerce Blocks.

* Update label and hide description

This commit updates the `HandPickedProductsControl` component. Specifically, the user-facing label for product selection has been changed from 'Pick some products' to 'Hand-picked Products'. Additionally, the `__experimentalShowHowTo` property has been added with a `false` value, to hide description. Corresponding changes have been made in the E2E test file `product-collection.block_theme.spec.ts`, where the filter name is updated to match the new label.

* Refactor: Replace custom HTML entity decoder with `@wordpress/html-entities`

Rationale:
- The shift to `@wordpress/html-entities` aligns with standard WordPress practices, ensuring consistency across the platform.
- Enhances maintainability by relying on a well-supported library rather than custom code.
- Simplifies the codebase by removing a redundant utility function.

This change enhances the robustness of our code and aligns with best practices in WordPress development.
2023-11-27 12:27:04 +05:30
Daniel Dudzic 38b0001735 Product Gallery Thumbnails: Fix overflow issues and improve responsiveness (https://github.com/woocommerce/woocommerce-blocks/pull/11665)
* Product Gallery Thumbnails: Refactor sizing in the editor and the front end

* Product Gallery Thumbnails: Change default vertical alignment to top and better control the width of the thumbnails

* Product Gallery Thumbnails: Restrict the bottom position thumbnails width based on the total number of thumbnails set

* Product Gallery: Remove hardcoded width for Thumbnails and the Large Image and update the width inside of the Dialog

* Product Gallery Thumbnails: Introduce thumbnails scaling based on the number of thumbnails

* Product Gallery Thumbnails: Fix editor thumbnails scaling

* Product Gallery Thumbnails: Remove unused column gap variable

* Product Gallery Thumbnails: Fix styling for vertical images

* Product Gallery: Remove the unused editor.scss file

* Product Gallery: Fix the placement of the Thumbnails block in the block template

* Product Gallery Dialog: Reset changes to the dialog

* update @wordpress/e2e-test-utils-playwright package

* don't update node version

* remove waitForSiteEditorFinishLoading function

* use visitSiteEditor util

* Product Gallery Thumbnails: Add code comments

* Product Gallery Thumbnails E2E: Fix the test checking the default position of the thumbnails

* Product Gallery E2E: Fix the test checking if the cropping setting works correctly

* Product Gallery Thumbnails: Hide the Thumbnails block if there aren't at least 2 thumbnails to display

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2023-11-24 21:31:02 +01:00
Karol Manijak b5e91ee460 Enable shrink columns option in Product Collection by default (https://github.com/woocommerce/woocommerce-blocks/pull/11821)
* Enable shrink columns option in Product Collection by default

* Improve tests about responsiveness

* Make regex allowing for floating pixels

* Related products should not use sticky and author attribute or have hardcoded queryId

* Bring back properties for Related Products as it's based on Propducts block, not Product Collection

* Enable shrink columns to fit by default in patterns
2023-11-23 10:10:19 +01:00
Luigi Teschio 3302b24313 Update @wordpress/e2e-test-utils-playwright package (https://github.com/woocommerce/woocommerce-blocks/pull/11866)
* update @wordpress/e2e-test-utils-playwright package

* don't update node version

* remove waitForSiteEditorFinishLoading function

* use visitSiteEditor util
2023-11-22 09:19:00 +01:00
David Arenas 9e9f0341e2 Interactivity API: implement the new `store()` API (https://github.com/woocommerce/woocommerce-blocks/pull/11071)
* Sync Interactivity API code with Gutenberg

* New store() API

* Store raw actions

* Update wc-interactivity-store implementation

* Replace `wc_store` with `wc_initial_state`

* Parse and populate initial state

* Allow store parts in `store()`

* Accept namespaces in directive paths

* Add $$namespace to directives' object values

* Make namespace parsing more robust

* Use DeepPartial type for store parts

* Do not pass `rawStore` to `afterLoad` callbacks

* Simplify `store()` a bit

* Implement `privateStore()`

* Sync context directive with Gutenberg

* Refactor scope and extract getters per scope

* Add namespace to getters and actions

* Remove current privateStore implementation

* Remove `afterLoad` option from `store`

* Use same proxy handlers for ns, getters and actions

* Set scope inside `evaluate`

* Refactor proxy handlers

* Improve types a bit

* Catch errors in async actions

* Implement stacks for scopes and namespaces

* Implement `getElement`

* Change directives object structure

* Remove unnecessary import

* Implement private stores

* Return value from sync actions

* Minor optimizations and improved comments

* Don't use async inside `data-wp-watch`

* Use a single Provider in context directive

* Remove DeepPartial type

* Do not check if element exists

* Add the `current` prop of state inside the scope

* Move getters outside scope

* Fix wc-key assignment

* Fix missing `navigate` in directives

* Fix namespace not being picked in the same element

* Deep merge raw stores instead of proxied ones

* Fix namespace assignment

* Allow forward slashes in namespaces

* Migration of Product Collection and Product Button blocks to the new `store()` API (https://github.com/woocommerce/woocommerce-blocks/pull/11558)

* Refactor Product Button with new store() API

* Use `wc_initial_state` in Product Button

* Fix namespace

* Remove unnecessary state

* Test namespaces in directive paths

* Add test context with namespace

* Simplify woo-test context

* Move addToCart and animations to a file

* Do not pass `rawStore` to `afterLoad` callbacks

* Move callbacks and actions back to the main file

Because the animation was broken.

* Remove selectors in favor of state

* Use default ns in `getContext` for state and actions

* Remove `afterLoad` callback

* Remove unnecessary ns

* Fix getContext in add-to-cart

* Replace namespace and delete unnecessary store

* Pass context types only once

* Use an alternative for requestIdleCallback

* Add previous react code for notices

* Add namespace to Product Collection block

* Replace getTextButton with getButtonText

* Add block name to the ProductCollection namespace

* fix style HTML code

* Remove circular deps error on the Interactivity API

* Product Gallery block: Migrate to new Interactivity API store (https://github.com/woocommerce/woocommerce-blocks/pull/11721)

* Migrate Product Gallery block to new Interactivity API store

* Fix some references

* Add missing data-wc-interactive

* Fix an additional namespace

* Remove unnecessary click handler

* Dialog working

* Refactor action names

* Reindex PHP array

There was some missing indexes, which turned the array into an object in JS.

* Remove unused event handlers

* Move next/previous logic to external function

* Move StorePart util to the types folder

* Rename namespace to `woocommerce/product-gallery`

* Undo product collection namespace renaming

* Remove unnecessary namespace

* Don't hide the large image on page load

* Minor refactorings

* Fix eslint error

* Fix php cs errors with spacing and double arrows alignment

* Disable no-use-before-define rule for eslint

* Disable @typescript-eslint/ban-types rule for eslint

* Fix parsed context error in e2e tests

* Fix context parser for Thumbnail image

* Move store to the top of the frontend file

* Add interactivity api utils to the @woocommerce/utils alias

* Replace deprecated event attribute

---------

Co-authored-by: Luis Herranz <luisherranz@gmail.com>
Co-authored-by: David Arenas <david.arenas@automattic.com>
Co-authored-by: roykho <roykho77@gmail.com>

---------

Co-authored-by: David Arenas <david.arenas@automattic.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: roykho <roykho77@gmail.com>

* Fix error when closing product gallery dialog with keyboard escape key

* use wc_initial_state instead of wc_store

---------

Co-authored-by: Luis Herranz <luisherranz@gmail.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: roykho <roykho77@gmail.com>
2023-11-21 11:46:15 +01:00
Mike Jolley 3a49ae4dd3 Add tests for company address field (https://github.com/woocommerce/woocommerce-blocks/pull/11807)
* Company field tests

* Click page body before unchecking box
2023-11-21 10:04:51 +00:00
Daniel Dudzic eaa9e74a58 Run E2E test suite on Twenty-Twenty Four (https://github.com/woocommerce/woocommerce-blocks/pull/11466)
* Run E2E test suite on Twenty Twenty-Four

* Update TT4 download URL to the stable one

---------

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2023-11-21 09:11:19 +00:00
Tung Du 73d89b77a7 Fix: Product Collection show products with correct stock statuses (https://github.com/woocommerce/woocommerce-blocks/pull/11708)
* update the get visibility query method

* fix the condition

* remove unnecessary test
2023-11-21 11:29:24 +07:00
Thomas Roberts eaab9950af Update Puppeteer E2E tests to WP 6.4.1 and disable failing ones (https://github.com/woocommerce/woocommerce-blocks/pull/11816)
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2023-11-20 13:06:12 +01:00
Thomas Roberts 894f8e9ac4 Remove unused Verticals client PHP tests (https://github.com/woocommerce/woocommerce-blocks/pull/11813) 2023-11-17 06:02:58 -08:00
Alexandre Lara c8ef0fb3af Product Gallery block: Restrict block to be available only on the Single Product template or the Product Gallery template part (https://github.com/woocommerce/woocommerce-blocks/pull/11664)
* WIP: experimenting with strategy pattern for block registration

* Add TemplateChangeDetector to BlocksRegistrationManager

* Handle blocks registration

* Fix issue causing blocks to be registered multiple times

* Allow register/unregister blocks when on pages or posts

* Add BlockRegistrationStrategy logic

* Fix import error

* Add doc comments for BlockRegistrationManager class

* Add doc comments to TemplateChangeDetector class

* Fix eslint errors

* Import domReady from @wordpress/dom-ready

* Prevent error when using blockName for registerBlockType function

* Add e2e tests to check for block availability in different contexts

* Add e2e tests to cover block availability on different contexts
2023-11-16 15:03:58 +00:00
Alexandre Lara 415e12c163 Product Gallery block: Add E2E tests to cover Variable Products (https://github.com/woocommerce/woocommerce-blocks/pull/11536)
* WIP: cover variable products in Product Gallery block

* Fix e2e tests for Product Gallery Large Image block

* Fix php cs error

* Fix eslint errors

* Fix php cs error

* Fix php cs error

* Fix import of file that does not exist

* Specify selected variable product for Large Image block E2E tests
2023-11-14 15:00:11 -03:00
Mike Jolley 02f9d97282 Playwright Fixes from the 11.5.x release branch (https://github.com/woocommerce/woocommerce-blocks/pull/11737)
* Adjust test to use legacy selector if block is not found

* Select block before transform

* Improve frame selector
2023-11-14 10:32:19 +00:00
Roy Ho 08b0ceff53 e2e: Add hacky workaround for product image gallery (https://github.com/woocommerce/woocommerce-blocks/pull/11655) 2023-11-08 13:55:35 -08:00
Saad Tarhi c1d2695fb0 Skip template related E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/11700) 2023-11-08 16:35:45 +01:00
Paulo Arromba b3b52dbff4 Fix Playwright E2E tests - SideEffects (https://github.com/woocommerce/woocommerce-blocks/pull/11638)
* Removed span text and test
2023-11-07 11:50:59 +00:00
Roy Ho 4cdffc3b07 Product Gallery: Add e2e tests for crop image option (https://github.com/woocommerce/woocommerce-blocks/pull/11559) 2023-11-06 07:17:25 -08:00
Tung Du a52234e757 Fix: Make filter block contextual - Editor (https://github.com/woocommerce/woocommerce-blocks/pull/11218) 2023-11-06 14:14:58 +07:00
Daniel Dudzic f74aafe1bf Product Gallery Thumbnails: Add View all overlay (https://github.com/woocommerce/woocommerce-blocks/pull/11087)
* Product Gallery Thumbnails: Add View All link to the last thumbnail (non-interactive)

* Product Gallery Thumbnails: Add interactivity to the View All overlay

* Product Gallery Thumbnails: Refactor View all html to make it more readable

* Product Gallery Thumbnails: Fix woocommerce/woocommerce-blocks#11100 - Load all thumbnails and hide the View all overlay when in Dialog

* Product Gallery Thumbnails: Fix woocommerce/woocommerce-blocks#11099 - Enable the dialog for the View all thumbnails overlay even when the 'Full-screen when clicked' setting is disabled

* Product Gallery Thumbnails: Remove unnecessary concatenation from the View all html

* Product Gallery Thumbnails: Abstract the View All conditions into separate functions for readability

* Product Gallery Thumbnails: Add escaping to the View all plain text string

* E2E: Fix the Sale Badge and Single Product Template tests by selecting the first Sale Badge
2023-11-02 21:05:20 +01:00
Mike Jolley 49606ce4b6 Fix state input in playwright (https://github.com/woocommerce/woocommerce-blocks/pull/11532) 2023-11-01 16:51:27 +00:00
Luigi Teschio 07a2e2fced Disable test eslint rule for test.ts file (https://github.com/woocommerce/woocommerce-blocks/pull/11497) 2023-10-31 11:16:40 +01:00
Alexandre Lara eed3c076e5 Playwright: Add eslint rule to prevent import `test` or `expect` from playwright library (https://github.com/woocommerce/woocommerce-blocks/pull/11475)
* Add eslint rule to prevent import from playwright lib

* Fix path for the rules folder
2023-10-30 11:23:40 -03:00
Saad Tarhi 96a291f1b7 Fix products incorrectly marked as discounted (https://github.com/woocommerce/woocommerce-blocks/pull/11386)
* Fix: Remove incorrect discount label

We don't want to mark a product as having a discount when price includes
additional costs

* Add "goToCart" E2E helper function

* Add the CartPage class

* Add the Cart product price E2E tests

* Remove unnecessary comments

* Mark the Cart shopper E2E testing file as a having side effects

* Fix the "Strict mode violation" error

* Try another fix for the "Strict mode violation"
2023-10-27 21:54:13 +01:00
Karol Manijak d74b0423e1 Remove authors filter from Product Collection block (https://github.com/woocommerce/woocommerce-blocks/pull/11427)
* Remove authors filter from Product Collection block

* Remove author filed in query

* Add back the author query argument in the final query builder

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2023-10-25 19:11:56 +02:00
Seghir Nadir 8bf13a7f4f Add Local Pickup event and Cart/Checkout page views events (https://github.com/woocommerce/woocommerce-blocks/pull/11225)
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2023-10-23 10:23:38 +00:00
Seghir Nadir 114f0b4059 Copy shipping phone to billing phone if sync is checked (https://github.com/woocommerce/woocommerce-blocks/pull/10603) 2023-10-20 17:41:57 +07:00
Luigi Teschio face8d2b57 Product Gallery: Add animation when large image changes (https://github.com/woocommerce/woocommerce-blocks/pull/11113)
* Add slide animation

* Remove placeholder and pagination (https://github.com/woocommerce/woocommerce-blocks/pull/11145)

* Add titles to patterns and set the aligment to Wide

* Replace product query patterns with product collection ones

* Remove pagination and no results query from product query patterns

* Add aspect ratio to the product image attributes

* Add portrait aspect ratio to product X column and product gallery patterns

* improve animation

* improve naming

* fix regression

* fix css

* improve code style

* remove check on tag image

* align image

* fix crash when zoom is disabled

* fix E2E tests

* improve CSS

---------

Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
2023-10-20 09:42:39 +02:00
Thomas Roberts 766fa1311d Move `CheckboxList` and create new `blocksComponents` package (https://github.com/woocommerce/woocommerce-blocks/pull/11214) 2023-10-17 02:47:34 -07:00
Luigi Teschio dfbef14b28 Archive Templates - Compatibility Layer: fix E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/11273)
* Archive Templates - Compatibility Layer: fix E2E tests

* remove unecessary step
2023-10-17 09:46:25 +02:00
Karol Manijak 276556a47c Revert woocommerce/woocommerce-blocks#10032 so All Products renders in the frontend (https://github.com/woocommerce/woocommerce-blocks/pull/11263) 2023-10-16 17:16:07 +02:00
Mike Jolley 2044798af6 Remove Shipping calculator settings and link to the WooCommerce admin settings (https://github.com/woocommerce/woocommerce-blocks/pull/11184)
* Remove block level options in favour of settings

* Remove calculator toggle test

* Update assets/js/blocks/cart/inner-blocks/cart-order-summary-shipping/block.tsx

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Remove unused attributes

---------

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2023-10-11 15:09:43 +01:00
Mike Jolley 75bac91787 Ensure validation of fields occurs when collapsing fields (https://github.com/woocommerce/woocommerce-blocks/pull/11199)
* Ensure validation of fields occurs when collapsing fields

* update click for edit button

* turn off pointer events when hidden

* Add visibility rule
2023-10-10 22:07:58 +01:00
Alexandre Lara a6ddae9dc3 Product Gallery block: Move inner block settings around to match the order from the design (https://github.com/woocommerce/woocommerce-blocks/pull/11170)
* Rearrange block settings to correct position

* Remove unnecessary comments

* Remove unused imports

* Fix e2e tests
2023-10-10 14:04:54 +02:00
Mike Jolley 27ae9acafc Remove all instances of GUTENBERG_EDITOR_CONTEXT (https://github.com/woocommerce/woocommerce-blocks/pull/11126) 2023-10-10 10:57:26 +00:00
Mike Jolley 3857dc6e04 WIP: Condensed Address Form Implementation (https://github.com/woocommerce/woocommerce-blocks/pull/11167)
* Add address card component

* Condensed shipping address

* Billing address

* Animations

* Fix editing state

* Toggle sections open in tests
2023-10-09 12:49:09 +01:00
Alexandre Lara dec4e4fc75 Product Gallery > Pager block: Add E2E tests for the block (https://github.com/woocommerce/woocommerce-blocks/pull/11001)
* Add e2e tests for Pager block

* Fix e2e tests for Product Gallery Pager

* Fix e2e tests
2023-10-04 19:11:34 +02:00
Saad Tarhi be2d0e8a43 Fix failing Playwright E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/11055)
* Revert woocommerce/woocommerce-blocks#11029 to fix failing E2E tests

* Revert woocommerce/woocommerce-blocks#10032

* Reapply changes from woocommerce/woocommerce-blocks#10032

* Skip failing E2E test

* Skip Price Filter Block failing tests

* Apply back changes from woocommerce/woocommerce-blocks#11029

* Fix Checkout template E2E tests
2023-09-28 22:02:02 +01:00
Karol Manijak 25bac5f030 Add condition to register blocks and variation in single product temp… (https://github.com/woocommerce/woocommerce-blocks/pull/10978)
* Add condition to register blocks and variation in single product template

* Improve the fix by providing default ancestor value to block registered for single product

* add E2E test

* add insert block

---------

Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2023-09-22 08:27:12 +02:00
Daniel Dudzic 8b470177f4 Product Gallery: CSS styling tightening up (https://github.com/woocommerce/woocommerce-blocks/pull/10867)
* Product Gallery: Fix conflicts between block settings and CSS

* Product Gallery: Final CSS polishes

* Product Gallery: Minor CSS refactor

* Product Gallery: Revert the minor css refactor

* add custom class on the main div

* Product Gallery: Combine inner block styles and optimize them

* Product Gallery Inner Blocks: Remove imports to no longer existing stylesheet files

* Product Gallery: Change all references from wp-block to wc-block

* Product Gallery Inner Blocks: Remove loading of non-existent inner blocks stylesheet files

* Product Gallery: Add additional class to ensure correct width for single product gallery despite of the Next/Previous mode selected

* Product Gallery: Add final polishing

* fix zoom

* Product Gallery Thumbnails: Fix css

* Product Gallery Large Image Next Previous Buttons: Skip failing tests

---------

Co-authored-by: Luigi <gigitux@gmail.com>
2023-09-21 11:31:16 +00:00
Alexandre Lara 3ecd34e01a Upgrade webpack to version 5 (https://github.com/woocommerce/woocommerce-blocks/pull/8013)
* Upgrade terser-webpack-plugin to version 4.2.3

* Upgrade webpack-bundle-analyzer to 4.7.0

* Upgrade to Webpack version 5

* Upgrade @wordpress/dependency-extraction-webpack-plugin to 4.6.0

* Upgrade dependency copy-webpack-plugin to version 11.0.0

* Upgrade dependency terser-webpack-plugin to version 5.3.6

* Replace webpack-rtl-plugin with the new @automattic/webpack-rtl-plugin

* Replace module.issuer with the new ModuleGraph API

There is a warning appearing in the console when running the application. This is due to the fact that the module.issuer has been deprecated on Webpack 5 and replaced with the new ModuleGraph API. This commit replaces the deprecated API with the new one.

* Upgrade babel and babel plugins to latest version

* Replace jsonpFunction with the new uniqueName property

Add a unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals. It defaults to output.library name or the package name from package.json in the context, if both aren't found, it is set to an ''.

* Replace cacheDirectory inline configuration with options.cacheDirectory

* Upgrade @wordpress/e2e-tests dependency to version 5.6.0

* Remove babel-plugin-transform-react-jsx dependency

Remove babel-plugin-transform-react-jsx dependency because it is already included in @wordpress/babel-preset-default

* Remove unnecessary Babel dependencies

Remove some unnecessary babel dependencies that are already included in the @babel/preset-env package.

* Upgrade puppeteer dependency to version 16.2.0

* Remove caret from package.json dependencies

* Fix Storybook build error

This commit fixes the Storybook build error that was being caused because of Storybook by default uses Webpack 4, but since we are currently upgrading our webpack to version 5, we need to install some required dependencies and also explicitly tell Storybook to use Webpack 5.

* Fix package-lock.json after merging with trunk

* Add own webpack-rtl-plugin implementation to the project

Before upgrading Webpack to version 5, we were using the original `webpack-rtl-plugin` released by Romain Berger; unfortunately, this plugin is not compatible with Webpack 5, so we replaced it with `@automattic/webpack-rtl-plugin`. The problem is that `@automattic/webpack-rtl-plugin` by default generates files with the '.rtl.css' suffix and does not provide a way to change that.

This commit adds our own implementation of the `webpack-rtl-plugin` (adapted from `@automattic/webpack-rtl-plugin`) that is compatible with Webpack 5 and allows us to change the suffix of the generated files to follow the recommended way defined by Wordpress (https://codex.wordpress.org/Right-to-Left_Language_Support)

* Change conditional clause to be multiline

* Fix package-lock.json after merge with trunk

* Fix package-lock.json after merge with trunk

* Rename files to fix ESLint errors

This commit renames files that have the .js extension but contain JSX code. This is causing ESLint to throw errors because by default our Eslint configuration expects only files with the .jsx extension to contain JSX code.

* Fix package-lock.json file

* Add is-plain-obj module to the transformIgnorePatterns of jest config

* Update package-lock.json

* Fix package-lock.json

* Upgrade @wordpress/i18n dependency to version 4.31.0

* Update package-lock.json

* Update composer lock file

* Fix Webpack config for Webpack 5

* Add the package-lock.json

* Remove unsupported config from webpack

* Fix error with Webpack build

* Add wait for network idle to the tests

* Attempt to fix e2e test

* Restore promise.all

* Upgrade puppeteer to v17.1.3

* Upgrade expect-puppeteer

* Update expect-puppeteer

* Downgrade expect-puppeteer

* Revert "Upgrade puppeteer to v17.1.3"

This reverts commit 61ed52a56f131961f3970b6fb22cdd8b540bada3.

* Upgrade Puppeteer to version 17.1.3

* Fix executionContext.frame is not a function error

* Fix e2e tests

* Remove isExperimentalBuild from Product Gallery inner blocks

* Upgrade Webpack and Webpack-cli to latest version

* Upgrade postcss and mini-css plugins

* Fix error with mini-cart block

* Fix styling error with filter blocks

* Fix issue when running unit tests

* Fix storybook script not loading

* Fix a11y issue in Storybook

* Fix error when multiple isExperimentalBuild was being used

* Prevent error when layout is not present in the attributes object

* Update `chunkIds` to `named` in Webpack

* Add cache groups to the Webpack configs
2023-09-20 17:31:52 -03:00
Mike Jolley edf4a95b23 Feature Branch: Blockified Order Confirmation (https://github.com/woocommerce/woocommerce-blocks/pull/10056)
* Main block types for confirmation

* Initial blocks

* Styling and placeholders

* Make blocks experimental

* Update summary icon

* Add name/description for status block and missing text descriptions in the block.

Closes woocommerce/woocommerce-blocks#10057

* Order confirmation: Convert Order Details Templates to Blocks (https://github.com/woocommerce/woocommerce-blocks/pull/10095)

* Move code from templates into the details block

* Details -> Totals

* Downloads block

* Sample content for downloads block

* Add block icon

* Add conversion template (https://github.com/woocommerce/woocommerce-blocks/pull/10077)

* Update inner block name

* Add default title constant

* Revert "Add default title constant"

This reverts commit 1dd3bbfecc1be83c367b1ab064f5032ea58cb678.

* Add global styles for order confirmation status block (https://github.com/woocommerce/woocommerce-blocks/pull/10164)

* Implement style controls

* Prevent link color spilling over onto wrapper

* Add styles and remove class names

* Remove __experimentalWritingMode

* Add global styles for order confirmation summary block (https://github.com/woocommerce/woocommerce-blocks/pull/10179)

* Styles for summary

* Remove __experimentalWritingMode

* Add table styles for order details (https://github.com/woocommerce/woocommerce-blocks/pull/10185)

* Add table styles for order details

* __experimentalFontWeight

* Add link styles

* Handle preview link styles

* Unauthenticated views for Order Confirmation template (https://github.com/woocommerce/woocommerce-blocks/pull/10414)

* Different views by permission

* check user id matches when logged out

* Add order confirmation wrapper block (https://github.com/woocommerce/woocommerce-blocks/pull/10286)

* Add a heading wrapper block

* Register the BillingWrapper Block server side

* Fix exception 'render_content' error

* Add the Billing Wrapper Block to the template

* Fix wrong block name error

* Fix php error

* Conditionally render Billing Address within the Wrapper

* Fix parent rendering

* Clean up code (remove billing address from the template)

* Update titles, descriptions, and icons of the billing Block and inner block

* Fix broken block by removing the "parent" keyword

* Use a user-friendly title and description for the Billing Wrapper

* Update Billing Wrapper Block's title case

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Fix PHP failing unit test

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Remove "thanks" for authenticated page

* Introduce shipping wrapper based on billing wrapper

Closes woocommerce/woocommerce-blocks#10053

* Order confirmation block: Verify email address for guest customers (https://github.com/woocommerce/woocommerce-blocks/pull/10567)

* Add verify step for guest orders

* Render content to pass through block content

* Revert package changes

* Customer orders cannot use email to verify

* Add style controls for order shipping and billing address blocks (https://github.com/woocommerce/woocommerce-blocks/pull/10633)

* Order confirmation block styling (https://github.com/woocommerce/woocommerce-blocks/pull/10780)

* Add missing heading to order details

* Summary block spacing

* Update css variables

* table styles

* Inherit border styles for cells

* Alignment and address styles

* Add downloads wrapper

* Style controls

* Fix typo

* Update Download Wrapper's Icon

* Fix TS error

* Disable Download Block's server side rendering in the editor

This fixes the loading after each style change from the style controls

* Clean up Downloads render functions

* Fix client side Downloads Block's table border

* Download + Total wrappers and tables styling

* small screen

* Remove server side render for previews

---------

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>

* Shorten template description

* Update test address data

* Avoid leaking order key in permission form

* Remove todo

* Make email form required.

* Remove edit page link

* Remove empty columns from address wrapper

* Remove IIFE

* typo

* Update description to mention billing

* Adjust link scss

* Fix wrapper markup and spacing controls

* Add link preview in editor

* Add initial E2E setup for the Order Confirmation Block (https://github.com/woocommerce/woocommerce-blocks/pull/10840)

* Fix WC_DateTime check

* Move form outside of block markup

* Add additional information block (https://github.com/woocommerce/woocommerce-blocks/pull/10842)

* Add block which contains hooks

* Use skeleton for placeholder instead of illustration

* Remove duplicate methods

* Remove duplicate align tag

* Update meta styles

* Tests for order confirmation conditional blocks (https://github.com/woocommerce/woocommerce-blocks/pull/10972)

* Add tests for conditional blocks

* Move setup into test

* Add E2E to the the Order Confirmation Block (https://github.com/woocommerce/woocommerce-blocks/pull/10863)

* Add editor util functions

* Update editor template E2E test

* Add the "exact" property for consistency

* Skip test

Can't get the element in the page. More investigation needed! Skipping
for now.

* Fix "transformIntoBlocks" logic

* Add tests for logged in user

* Fix "beforeAll" config

* Confirm downloads section is visible when logged in

* Create "verifyOrderConfirmationDetails" util function

* Add logged in test case

* Add Guest user test case

* Fix editor e2e testing

* Apply a proper teardown

* Fix failing tests after logout

* Ensure we are logged in before visiting the editor

* Ensure to have shipping selected

* Wait for changes to be saved on the editor

* Ensure shipping options is selected

* Remove comment

* Ensure we are logged in before going to the admin page

* Mark the Order Confirmation as a side effect test

* OrderConfirmation blocks are not experimental

* resolve merge conflict

* Revert package lock changes

* Fix enqueue_assets

* Fix CSS 404s

* Make template tests more robust

* Fix page URL for default confirmation page

* Try afterEach to log back in

* Skip guest/logout use cases

Login out causes other tests to fail. We will implement these case when
the multiple sign in roles are introduced in the codebase.

* Remove tests requiring login out & add comments

* Remove unused util functions

* Hide confirmation blocks from post editor

---------

Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-09-20 13:56:00 +01:00
Luigi Teschio 35e82fe4ec Fix: Password Protection not respected on single product template (https://github.com/woocommerce/woocommerce-blocks/pull/10999)
* Add password protection on the blockified Single Product Template

* Add E2E test

* fix unit test

* remove empty space
2023-09-20 07:17:13 +00:00
Mike Jolley 68064c115b Refactor Cart and Checkout Page Templates (https://github.com/woocommerce/woocommerce-blocks/pull/10773)
* Rename checkout template slug

* Remove redirect and custom title

* Classic shortcode block for checkout

* Empty title

* WIP placeholder

* Change blockified template

* Prefix cart and checkout templates with "Page: "

* Template migration routine

* Apply same treatment to cart template

* Notices

* Update placeholder text

* Classic shortcodes block

* Page content wrapper for templates

* Update default

* Do not save attributes

* Update templates

* Remove cart classic template

* Reverted endpoints for Cart & Checkout templates. This reverts PR 9406

* Migrate page content wrapper.

* Removed useless method arg. Minor tweaks.

* Skip migration if the theme has a template file for this page.

* Removed impossible condition.

* Migrate page content wrapper.

* Remove TemplateNotice in favour of DefaultNotice

* Documentation links in shortcode placeholder

* Hide cart and checkout page selector when using block themes

* Unused var

* Add tests for template changes

* Revert changes to classic-template

* Allow frontend redirect

* Unused file

* Bump version for updater

* Support x template naming as well as page-x

* Need to add item to cart to test checkout

* Fix header test by fixing utility for adding to cart

* Remove permalink tests

* Click body

* Wait for content to finish loading

* Wait for add to cart response when adding to cart without item name

* Wait for save before visiting frontend

* Set content instead of inserting block

* Perform test in site editor rather than page editor

* Prevent notice to set the default cart/checkout page from showing on the site editor.

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2023-09-19 10:58:18 +01:00
Patricia Hillebrandt 067626a155 Store Customization > Create a new endpoint within Store API for updating patterns with AI-generated content (https://github.com/woocommerce/woocommerce-blocks/pull/10881)
* Add the Jetpack Connection Package as a dependency for WooCommerce Blocks.

* Introduce the new Configuration Class for registering and enabling the Jetpack connection for sites and users.

* Introduce the Connection class for making requests to the GPT AI API.

* Update the get_jwt_token method.

* Update the error messages for the get_jwt_token method.

* Update the register_site method.

* Update the Configuration class structure and add Dependency Injection.

* Update structure for the Connection Class.

* Update the return type for the get_jwt_token method.

* Update method visibility for get_site_id

* Update the name and params for methods within the Connection Class

* Add tests for the Connecction class.

* Update the Constructor for the Configuration class.

* Add the Patterns class.

* Update the VerticalsSelector class.

* Update the constructor for PatternImages.

* Update the Store API Route for Patterns.

* Update the create_patterns_content method to ensure it returns the results of update_option.

* Add the new Patterns route to the RoutesController class.

* Update the route path and remove the business description validation as that is done via create_patterns_content

* Introduce the PatternsSchema

* Update the prompt, errors messages and output format for the Verticals Selector.

* Fix the missing file error for the Patterns Dictionary.

* Introduce the new get_patterns_dictionary method and update the create_patterns_content method to better handle errors.

* Update the returned response for the endpoint.

* Add the get_item_response method to the PatternsSchema class.

* Update response for when allow_ai_connection option is not set.

* Enable authentication for the endpoint.

* Modify and temporarily remove some failing tests for the AI API: a separate PR will be opened to clear those out later.
2023-09-15 15:44:15 +00:00
Luigi Teschio 11062e8600 Product Gallery Block: Add Product Gallery template to allow users to edit full mode view (https://github.com/woocommerce/woocommerce-blocks/pull/10823)
* Product Gallery: add support for On Sale Badge Block

* add align support

* Add E2E tests

* set margin via Block Styles

* disable experimental flag

* add next previous block

* restore support file

* fix TS error

* fix layout

* change product

* change product

* Product Gallert Block: Add zoom on hover

* set to true by default

* remove block is already registered error

* remove unecessary await

* Improve zoom logic

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>

* Product Gallery Full view mode: Add the logic to render the dedicated template

* use template-part instead template

* add E2E tests

* update selectors

* add feature flag product gallery template part

* fix E2E tests

* remove not necessary file

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-09-15 08:54:49 +00:00
Patricia Hillebrandt deb71f97fa Store Customization > Implement Client for requests to the GPT API (https://github.com/woocommerce/woocommerce-blocks/pull/10846)
* Add the Jetpack Connection Package as a dependency for WooCommerce Blocks.

* Introduce the new Configuration Class for registering and enabling the Jetpack connection for sites and users.

* Introduce the Connection class for making requests to the GPT AI API.

* Update the get_jwt_token method.

* Update the error messages for the get_jwt_token method.

* Update the register_site method.

* Update the Configuration class structure and add Dependency Injection.

* Update structure for the Connection Class.

* Update the return type for the get_jwt_token method.

* Update method visibility for get_site_id

* Update the name and params for methods within the Connection Class

* Add tests for the Connecction class.

* Update the Constructor for the Configuration class.
2023-09-12 08:41:43 +00:00
Daniel Dudzic 9db927de30 Product Gallery Thumbnails: Interactivity API directives (https://github.com/woocommerce/woocommerce-blocks/pull/10776)
* Fix "On sale" badge class for shop

* Add class to sale badge

* Move the thumbnails featching logic to an utils file. Add context directive with thumbnails data to the Product Gallery block. Add on-click directives to the Thumbnails block

* Product Gallery Thumbnails: Remove the legacy thumbnail markup

* Product Gallery Thumbnails: Add Large Image replacing

* update the main image when the thumbnail is clicked

* add E2E tests

* fix typo

* fix warning on the frontend

* address feedback

* update E2E test

* improve comment

* fix indentation

* improve E2E test

* improve flaky test

* improve E2E test

* improve comments

* improve E2E test

* try now

* add comment

* skip test

* reset script

* update todo comment

---------

Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
2023-09-12 09:36:44 +02:00
Alba Rincón 2d5d336aad [Store Customization] Make request to the Verticals API to fetch matching images and classify them (https://github.com/woocommerce/woocommerce-blocks/pull/10789)
* Add the Verticals API client

* Add tests

* Refactor error handling

* Create first version of the prompt class

* Improve Vertical selector and add tests

* Remove testing code

* Update class comment

* Add PatternImages class

* Pass the dictionary as param

* Add tests

---------

Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-09-11 15:39:15 +00:00
Alba Rincón 9d803a287a [Store Customization] Create a service to get the selected vertical from the business description and the verticals (https://github.com/woocommerce/woocommerce-blocks/pull/10778)
* Add the Verticals API client

* Add tests

* Refactor error handling

* Create first version of the prompt class

* Improve Vertical selector and add tests

* Remove testing code

* Update class comment

---------

Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-09-11 15:24:43 +00:00
Luigi Teschio 3c7b47b7d1 Product Gallery: fix warning (https://github.com/woocommerce/woocommerce-blocks/pull/10839)
* Product Gallery: fix warning

* address feedback

* fix logic

* rename function
2023-09-08 16:06:48 +02:00
Luigi Teschio 43c56e5383 Product Gallery Block: Add zoom on hovering on the frontend (https://github.com/woocommerce/woocommerce-blocks/pull/10791)
* Product Gallery: add support for On Sale Badge Block

* add align support

* Add E2E tests

* set margin via Block Styles

* disable experimental flag

* add next previous block

* restore support file

* fix TS error

* fix layout

* change product

* change product

* Product Gallert Block: Add zoom on hover

* set to true by default

* remove block is already registered error

* remove unecessary await

* Improve zoom logic

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>

* Product Gallery Block: Add E2E tests for zoom while hovering setting (https://github.com/woocommerce/woocommerce-blocks/pull/10795)

---------

Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
2023-09-05 15:22:17 +02:00
Karol Manijak d9e17accf1 Fix the artifacts path for classic theme (https://github.com/woocommerce/woocommerce-blocks/pull/10837) 2023-09-05 15:03:56 +02:00
Alexandre Lara 2ebe7bd0c9 Product Gallery > Pager block: Fix block alignment (https://github.com/woocommerce/woocommerce-blocks/pull/10782)
* Fix block alignment with Large Image block

* Prevent error when layout is not present in the attributes object

* Add Large Image and Pager to its own group

* Fix issue when moving around the thumbnails block

* Fix e2e tests for Product Gallery block

* Change ancestor block for the Pager block
2023-09-05 09:52:19 -03:00
Sam Seay abd41cae11 Fixes for jest transpilation issues. (https://github.com/woocommerce/woocommerce-blocks/pull/10788)
* Fix bug where is-plain-obj is not transpiled by Jest, update lock.
* Update packages.
* Mock useSelect for a handful of RichText selectors in test.
* Resolve react to single version to avoid invalid hook errors.
* Patch trim-html locally to avoid a bug in the released npm source.
* Mock out resizeObserver to avoid https://github.com/FezVrasta/react-resize-aware/issues/58
* Don't transpile config package: https://github.com/node-config/node-config/issues/628
2023-09-05 04:03:35 +00:00
Karol Manijak ac7e115c3e Update @wordpress/env to 8.1.1 and re-enable PHP Unit Tests for PHP v 8.1 and 8.2 (https://github.com/woocommerce/woocommerce-blocks/pull/9875)
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Tung Du <dinhtungdu@gmail.com>
2023-09-01 16:07:55 +07:00
Luigi Teschio 22b9f6a952 Product Gallery Block: add support for the on Sale Badge block (https://github.com/woocommerce/woocommerce-blocks/pull/10764)
* Product Gallery: add support for On Sale Badge Block

* add align support

* Add E2E tests

* set margin via Block Styles

* disable experimental flag

* add next previous block

* restore support file

* fix TS error

* fix layout

* change product
2023-08-31 18:15:31 +02:00
Luigi Teschio 2d89f4892d add side_effects suffix to the Product Gallery Large Image Next Previous Block (https://github.com/woocommerce/woocommerce-blocks/pull/10766) 2023-08-29 16:19:20 +02:00
Alba Rincón 035d8249ab [Store Customization MVP] Verticals API client (https://github.com/woocommerce/woocommerce-blocks/pull/10687)
* Add the Verticals API client

* Add tests

* Refactor error handling
2023-08-29 10:13:25 +02:00
Tung Du a92b8a432f E2E: ensure the shop page is created by creating it manually (https://github.com/woocommerce/woocommerce-blocks/pull/10744) 2023-08-29 08:00:29 +07:00
Luigi Teschio c126731347 Product Gallery Block: Next/Previous block (https://github.com/woocommerce/woocommerce-blocks/pull/10235)
* Add Product Gallery Next Previous block

* update description

* update registration

* improve style

* use context instead of attributes

* add eslint and ts lint exception

* improve CSS

* E2E Next Previous block (https://github.com/woocommerce/woocommerce-blocks/pull/10329)

* Add E2E tests

* fix e2e tests path after rebase

* add screenshots

* improve E2E test

* improve E2E test

* improve E2E test

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>

* fix webpack conf

* Next Previous Button block - Add layout support (https://github.com/woocommerce/woocommerce-blocks/pull/10668)

* Add layout support

* Product Gallery Next Previous: Fix block crashing in the editor when vertical alignment has not been customized yet

* Product Gallery Next Previous: Position fixes for the Next/Previous button both in the editor and frontend

* add E2E test

* fix import

---------

Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>

* Next Previous Buttons: hide buttons when the product has only one image (https://github.com/woocommerce/woocommerce-blocks/pull/10743)

* Next Previous Buttons: hide buttons when the product has only one image

* update URL

* fix import

* set default value

* fix E2E test

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
2023-08-28 18:32:45 +02:00
Thomas Roberts 55f65cdf17 Move cart widget tests to playwright and ensure classic/block theme configs are executed correctly (https://github.com/woocommerce/woocommerce-blocks/pull/10669) 2023-08-28 03:04:28 -07:00
Tung Du 69d5f47048 E2E: Refactor Mini Cart to be ready for fully parallel (https://github.com/woocommerce/woocommerce-blocks/pull/10704) 2023-08-24 20:33:20 +07:00