woocommerce/plugins/woocommerce-blocks/tests/utils
Thomas Roberts 991e407fa9 Remove WC Core shipping settings if Cart/Checkout blocks are in use (https://github.com/woocommerce/woocommerce-blocks/pull/8679)
* Add CartCheckoutUtils class

This class will store reusable methods relating to Cart/Checkout Blocks, i.e. whether they are used on the Cart/Checkout page.

* Update ShippingController to use the new CartCheckoutUtils function

This will reduce code duplication when checking if the Cart/Checkout blocks are in use on the Cart/Checkout page.

* Add filter to remove shipping settings when Cart/Checkout are default

* Ensure setting displays correctly if cart is default but not checkout

* Add tests to ensure core shipping settings update correctly

* Add setCartCheckoutPages function to update set the cart/checkout page

* Force shipping to be enabled if the Checkout block is in use.

* Add filter to override cost requires address option

* Add shippingCostRequiresAddress option

* Check if the address is required before showing rates

* Show shipping rates in editor

* Add shippingCostRequiresAddress attribute to shipping methods block

* Update frontend type to show shippingCostRequiresAddress is a prop

* Add control to toggle shippingCostRequiresAddress option

* Show address notice in the correct scenario

* Send shippingCostRequiresAddress to Block in front end context

* Add e2e test for editor control

* Add e2e tests for shipping options on the front end

* Add updateAttributeInSiblingBlock function

* Add shippingCostRequiresAddress to shipping method block

* Ensure attribute is updated in both blocks when editing

* In Shipping Methods Block, show correct component based on block setting

* Show correct block in editor

* Remove broken test from PR

* Clean up updateAttributeInSiblingBlock

* Add setCartCheckoutPages function to update set the cart/checkout page

* Add tests to ensure core shipping settings update correctly

* Add isAddressComplete function

Borrowed from woocommerce/woocommerce-blocks#8141

* Check if the address is required before showing rates

* Show shipping rates in editor

* Show address notice in the correct scenario

* Add e2e tests for shipping options on the front end

* Ensure errorId is passed to StateInput

* Add fullShippingAddressPushed action to wc/store/cart

* Add fullShippingAddressPushed case to reducer

* Ensure fullShippingAddressPushed is set when initialising cart store

* Add fullShippingAddressPushed selector and default state entry

* Add shippingAddressHasValidationErrors util function

* Do not overwrite addresses when selecting a rate

* Set whether full address has been pushed when saving address changes

* In Shipping Methods Block, show correct component based on block setting

* Don't show from price if rates should be hidden until address entered

* Check city validation errors to assert if shipping address is valid

* Rename merchant.js to merchant.ts

* Move local pickup functions to common merchant util

* Update local pickup tests to use common merchant utils

* Add test to ensure setting toggles in both blocks

* Add navigating to settings and saving in merchant util

* Create addPickupLocation merchant util

* Add test for local pickup and require full address

* Make sure correct conditions are met to show shipping options

* Ensure checkbox is checked during local pickup tests

* Unset the checkbox when tests are finished running

* Update checkout block fixture

* Prevent error in unit tests

* Import validation store key from constants

Required because importing from the index causes the validation data store to register twice

* Update checkout terms test to wait for button not to be disabled

* Revert "Add isAddressComplete function"

This reverts commit 9967dc0d4f10cf638859ae085e6f4cc2901dd299.
2023-03-13 11:49:28 +00:00
..
clickLink.js Fix E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/6415) 2022-06-13 11:15:29 +02:00
compatibility-notice.js Fix ESLint: use window.localstorage instead localstorage woocommerce/woocommerce-blocks#6442 (https://github.com/woocommerce/woocommerce-blocks/pull/6540) 2022-06-09 14:47:17 +02:00
constants.js E2E: Fixing failed tests with Gutenberg (https://github.com/woocommerce/woocommerce-blocks/pull/7554) 2022-11-16 08:52:51 +07:00
find-by-text.ts Update @woocmmerce/eslint-plugin to 2.0.0 (https://github.com/woocommerce/woocommerce-blocks/pull/6203) 2022-04-08 14:47:19 +01:00
find-label-with-text.js Enable and fix all jsdoc rule violations (https://github.com/woocommerce/woocommerce-blocks/pull/3168) 2020-09-20 19:54:08 -04:00
find-tools-panel-with-title.ts Fix broken E2E tests cause by edit template button class name change in latest Gutenberg release (https://github.com/woocommerce/woocommerce-blocks/pull/8107) 2023-01-09 23:44:53 +07:00
get-block-page-permalink.js Remove custom ensureSidebarOpened() (https://github.com/woocommerce/woocommerce-blocks/pull/6359) 2022-05-05 07:14:07 +07:00
get-fixture-products-data.ts Product Query E2E tests: Sale and Stock status filters tests (https://github.com/woocommerce/woocommerce-blocks/pull/7684) 2022-11-21 08:08:12 +07:00
get-form-element-id-by-label.ts Fix broken E2E tests cause by edit template button class name change in latest Gutenberg release (https://github.com/woocommerce/woocommerce-blocks/pull/8107) 2023-01-09 23:44:53 +07:00
get-normal-page-permalink.js Ensure cart changes remain after using back button to get back to the cart (https://github.com/woocommerce/woocommerce-blocks/pull/3960) 2021-03-24 13:28:11 +00:00
get-toggle-id-by-label.ts Fix broken E2E tests cause by edit template button class name change in latest Gutenberg release (https://github.com/woocommerce/woocommerce-blocks/pull/8107) 2023-01-09 23:44:53 +07:00
index.js Fix E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/8263) 2023-01-25 16:41:22 +01:00
insert-block-using-quick-inserter.ts E2E: Fixing failed tests with Gutenberg (https://github.com/woocommerce/woocommerce-blocks/pull/7554) 2022-11-16 08:52:51 +07:00
insert-block-using-slash.ts E2E: Fixing failed tests with Gutenberg (https://github.com/woocommerce/woocommerce-blocks/pull/7554) 2022-11-16 08:52:51 +07:00
insert-inner-block.ts E2E: Fixing failed tests with Gutenberg (https://github.com/woocommerce/woocommerce-blocks/pull/7554) 2022-11-16 08:52:51 +07:00
insert-shortcode-block.ts E2E: Product Query: Popular filters presets (https://github.com/woocommerce/woocommerce-blocks/pull/7749) 2023-01-05 18:21:22 +07:00
merchant.ts Remove WC Core shipping settings if Cart/Checkout blocks are in use (https://github.com/woocommerce/woocommerce-blocks/pull/8679) 2023-03-13 11:49:28 +00:00
path-expressions.js Shopper → Cart → Can update product quantity (https://github.com/woocommerce/woocommerce-blocks/pull/6025) 2022-03-23 13:51:56 +01:00
performance.ts Try adding performance tests (https://github.com/woocommerce/woocommerce-blocks/pull/6119) 2022-04-04 13:30:07 +01:00
run-cli-from-test.js E2E tests for translated Cart & Checkout blocks (https://github.com/woocommerce/woocommerce-blocks/pull/6101) 2022-03-28 16:20:59 +01:00
save-or-publish.js Add E2E tests for Filter blocks (Price, Attribute, and Active Filters) (https://github.com/woocommerce/woocommerce-blocks/pull/4562) 2021-12-23 17:26:10 +01:00
scroll-to.ts Add initial e2e tests to Checkout block frontend (https://github.com/woocommerce/woocommerce-blocks/pull/4004) 2021-04-14 15:50:27 +01:00
select-block-by-name.js Update Checkout to Checkout i2 (https://github.com/woocommerce/woocommerce-blocks/pull/4745) 2021-09-16 13:16:21 +01:00
selectors.ts E2E: Fixing failed tests with Gutenberg (https://github.com/woocommerce/woocommerce-blocks/pull/7554) 2022-11-16 08:52:51 +07:00
shopper.js Fix E2E tests - Wait for the Checkout to push changes before proceeding with tests (https://github.com/woocommerce/woocommerce-blocks/pull/8502) 2023-02-24 06:27:56 -08:00
switch-block-inspector-tab-when-gutenberg-is-installed.ts Fix E2E tests (https://github.com/woocommerce/woocommerce-blocks/pull/8263) 2023-01-25 16:41:22 +01:00
taxes.ts Fix/flakey checkout tests (https://github.com/woocommerce/woocommerce-blocks/pull/7508) 2022-10-28 13:41:28 +01:00
visit-block-page.js Fix e2e tests related to inserting blocks (https://github.com/woocommerce/woocommerce-blocks/pull/8462) 2023-02-20 10:10:41 +01:00