woocommerce/plugins/woocommerce-blocks/assets/js/data/payment/test
Thomas Roberts c5aecceb5a Allow observers to set `billingAddress` by returning `billingData` (https://github.com/woocommerce/woocommerce-blocks/pull/8163)
* Allow observers to set billingAddress by returning billingData

This is required since we didn't correctly deprecate billingData when we changed the name to billingAddress

* Add link to original PR

* Set billingAddress when observer errors

* Rename  shippingData to shippingAddress

* Add isBillingAddress and isShippingAddress type guards

* Add tests for new type guards

* Only set billing and shipping if they are valid objects

* Add tests for __internalEmitPaymentProcessingEvent thunk

* Update deprecated version

* Return promise from this function to aid with testability

* Add tests for shippingAddress and paymentMethodData

* Ensure correct value is used to set shipping address

* Move test data out of tests to aid with reusability

* Improve success callback name

* Add mocked __internalSetPaymentMethodData to correct object

It was in registry, but should be in dispatch as the action is on the same store as the thunk. Registry is used for actions on other stores.

* Add test for failed observers

* Add test for mixed observers

* Add comments explaining the destructure & deprecation
2023-01-23 08:27:59 -08:00
..
actions.ts Move payment utils and delete orderPaymentMethods (https://github.com/woocommerce/woocommerce-blocks/pull/7679) 2022-11-16 09:38:48 +00:00
check-payment-methods.tsx Simplify @woocommerce/types imports (https://github.com/woocommerce/woocommerce-blocks/pull/8019) 2022-12-23 18:59:02 +07:00
reducers.js Highlight incompatible payment gateways (https://github.com/woocommerce/woocommerce-blocks/pull/7412) 2022-12-28 17:30:46 +01:00
selectors.js Fix wrong keys being sent in `canMakePayment` and customer data showing in the Checkout block in the editor (https://github.com/woocommerce/woocommerce-blocks/pull/7434) 2022-10-20 08:02:43 -07:00
set-default-payment-method.ts Move payment utils and delete orderPaymentMethods (https://github.com/woocommerce/woocommerce-blocks/pull/7679) 2022-11-16 09:38:48 +00:00
thunks.tsx Allow observers to set `billingAddress` by returning `billingData` (https://github.com/woocommerce/woocommerce-blocks/pull/8163) 2023-01-23 08:27:59 -08:00