@lookiero/checkout 8.14.0-beta.2 → 8.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +1 -1
- package/cypress/integration/checkout.spec.ts +259 -0
- package/cypress/support/e2e.ts +3 -0
- package/cypress/support/index.d.ts +8 -0
- package/cypress/support/interceptBlockCheckoutBooking.ts +4 -0
- package/cypress/support/interceptGiveCheckoutFeedback.ts +4 -0
- package/cypress/support/interceptKeepCheckoutItem.ts +4 -0
- package/cypress/support/interceptListCheckoutQuestionsByCheckoutId.ts +9 -0
- package/cypress/support/interceptListReturnQuestionsByCheckoutItemId.ts +9 -0
- package/cypress/support/interceptPayment.ts +23 -0
- package/cypress/support/interceptReplaceCheckoutItem.ts +4 -0
- package/cypress/support/interceptReturnCheckoutItem.ts +4 -0
- package/cypress/support/interceptSubmitCheckout.ts +4 -0
- package/cypress/support/interceptViewBookedProductsVariantsForCheckoutItem.ts +9 -0
- package/cypress/support/interceptViewCheckoutById.ts +6 -0
- package/cypress/support/interceptViewFirstAvailableCheckoutByCustomerId.ts +9 -0
- package/cypress/support/interceptViewFiveItemsDiscountByCustomerId.ts +6 -0
- package/cypress/support/interceptViewIsSizeChangeEnabledByCheckoutId.ts +6 -0
- package/cypress/support/interceptViewPaymentFlowPayloadByCheckoutId.ts +9 -0
- package/cypress/support/interceptViewPricingByCheckoutId.ts +6 -0
- package/cypress/tsconfig.json +8 -0
- package/cypress.config.ts +50 -0
- package/dist/src/ExpoRoot.js +2 -2
- package/dist/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.js +1 -1
- package/dist/src/infrastructure/ui/Root.d.ts +0 -2
- package/dist/src/infrastructure/ui/Root.js +2 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.d.ts +0 -5
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +5 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.d.ts +0 -5
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.js +1 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/isChildReturnQuestion.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.d.ts +3 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +4 -8
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.js +1 -0
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +8 -6
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +4 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.d.ts +1 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.js +1 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +7 -5
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.d.ts +1 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +6 -4
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +6 -5
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.js +18 -9
- package/dist/src/infrastructure/ui/routing/Routing.d.ts +0 -7
- package/dist/src/infrastructure/ui/routing/Routing.js +5 -5
- package/dist/src/infrastructure/ui/views/App.d.ts +0 -8
- package/dist/src/infrastructure/ui/views/App.js +6 -8
- package/dist/src/infrastructure/ui/views/item/Item.d.ts +0 -5
- package/dist/src/infrastructure/ui/views/item/Item.js +3 -3
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.d.ts +0 -2
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +2 -2
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +1 -1
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +1 -1
- package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.d.ts +1 -5
- package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.js +2 -2
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.d.ts +0 -5
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +3 -3
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.d.ts +3 -3
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.js +2 -2
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.d.ts +1 -1
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.js +1 -1
- package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.d.ts +0 -2
- package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +2 -2
- package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.d.ts +0 -5
- package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.js +2 -2
- package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.d.ts +0 -5
- package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.js +2 -2
- package/dist/src/infrastructure/ui/views/return/Return.d.ts +0 -5
- package/dist/src/infrastructure/ui/views/return/Return.js +2 -2
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +0 -5
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +15 -13
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +6 -2
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.js +6 -2
- package/dist/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.js +2 -2
- package/dist/src/projection/returnQuestion/returnQuestion.constants.d.ts +9 -0
- package/dist/src/projection/returnQuestion/returnQuestion.constants.js +10 -0
- package/dist/src/projection/returnQuestion/returnQuestion.d.ts +23 -16
- package/dist/src/projection/returnQuestion/returnQuestion.js +1 -11
- package/dist/src/projection/returnQuestion/returnQuestion.metadata.d.ts +12 -0
- package/dist/src/projection/returnQuestion/returnQuestion.metadata.js +1 -0
- package/dist/src/projection/returnQuestion/returnQuestion.typeguard.d.ts +5 -0
- package/dist/src/projection/returnQuestion/returnQuestion.typeguard.js +10 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/jest.setup.js +0 -20
- package/package.json +9 -8
- package/src/ExpoRoot.tsx +2 -2
- package/src/infrastructure/domain/uiSetting/react/useUpdateUiSetting.test.ts +1 -1
- package/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.ts +1 -1
- package/src/infrastructure/projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId.test.ts +4 -9
- package/src/infrastructure/projection/returnQuestion/returnQuestions.mock.ts +72 -117
- package/src/infrastructure/ui/Root.tsx +1 -4
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.test.tsx +10 -12
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.tsx +11 -22
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.test.tsx +10 -9
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.tsx +1 -8
- package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/isChildReturnQuestion.ts +2 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.test.tsx +7 -9
- package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.tsx +3 -3
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.ts +4 -9
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.test.tsx +7 -13
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.tsx +4 -2
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.test.tsx +8 -14
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.tsx +13 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.tsx +7 -5
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.ts +1 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.test.tsx +10 -14
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +8 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.tsx +5 -5
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.test.tsx +43 -36
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +10 -9
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +13 -14
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.test.tsx +8 -14
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.tsx +6 -4
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +8 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.test.tsx +23 -25
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.tsx +5 -3
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.test.tsx +9 -29
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +7 -5
- package/src/infrastructure/ui/components/organisms/returnQuestions/util/__snapshots__/returnQuestionFeedback.test.ts.snap +5 -4
- package/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.ts +32 -18
- package/src/infrastructure/ui/routing/Routing.tsx +5 -13
- package/src/infrastructure/ui/views/App.tsx +11 -21
- package/src/infrastructure/ui/views/item/Item.tsx +2 -8
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.ts +1 -1
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +3 -9
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +7 -0
- package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +1 -8
- package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +5 -16
- package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.ts +1 -1
- package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.tsx +6 -6
- package/src/infrastructure/ui/views/item/components/selectModal/__snapshots__/SelecModal.test.tsx.snap +7 -0
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +3 -4
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +7 -0
- package/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.tsx +2 -12
- package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.tsx +4 -14
- package/src/infrastructure/ui/views/return/Return.tsx +1 -8
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.ts +6 -2
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +39 -34
- package/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.tsx +2 -2
- package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/CollapsiblePricing.test.tsx.snap +2 -2
- package/src/projection/returnQuestion/listReturnQuestionsByCheckoutItemId.test.ts +4 -12
- package/src/projection/returnQuestion/returnQuestion.constants.ts +10 -0
- package/src/projection/returnQuestion/returnQuestion.metadata.ts +17 -0
- package/src/projection/returnQuestion/returnQuestion.ts +42 -20
- package/src/projection/returnQuestion/returnQuestion.typeguard.ts +24 -0
- package/dist/pact.config.d.ts +0 -13
- package/dist/pact.config.js +0 -9
- package/dist/public/public/assets/adaptive-icon.png +0 -0
- package/dist/public/public/assets/favicon.png +0 -0
- package/dist/public/public/assets/icon.png +0 -0
- package/dist/public/public/assets/splash.png +0 -0
- package/dist/public/public/images/not-found.png +0 -0
- package/dist/src/infrastructure/projection/bookedProductsVariants/bookedProductsVariants.mock.d.ts +0 -3
- package/dist/src/infrastructure/projection/bookedProductsVariants/bookedProductsVariants.mock.js +0 -27
- package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +0 -48
- package/dist/src/infrastructure/projection/checkout/checkout.mock.d.ts +0 -19
- package/dist/src/infrastructure/projection/checkout/checkout.mock.js +0 -21
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +0 -109
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +0 -49
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +0 -44
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +0 -44
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +0 -44
- package/dist/src/infrastructure/projection/checkoutBooking/checkoutBooking.mock.d.ts +0 -3
- package/dist/src/infrastructure/projection/checkoutBooking/checkoutBooking.mock.js +0 -6
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +0 -49
- package/dist/src/infrastructure/projection/checkoutItem/checkoutItem.mock.d.ts +0 -15
- package/dist/src/infrastructure/projection/checkoutItem/checkoutItem.mock.js +0 -43
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +0 -50
- package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.d.ts +0 -3
- package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.js +0 -103
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +0 -48
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +0 -109
- package/dist/src/infrastructure/projection/payment/paymentFlowPayload.mock.d.ts +0 -6
- package/dist/src/infrastructure/projection/payment/paymentFlowPayload.mock.js +0 -183
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +0 -48
- package/dist/src/infrastructure/projection/pricing/pricing.mock.d.ts +0 -9
- package/dist/src/infrastructure/projection/pricing/pricing.mock.js +0 -42
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +0 -48
- package/dist/src/infrastructure/projection/returnQuestion/returnQuestions.mock.d.ts +0 -3
- package/dist/src/infrastructure/projection/returnQuestion/returnQuestions.mock.js +0 -400
- package/dist/src/infrastructure/ui/views/App.style.d.ts +0 -6
- package/dist/src/infrastructure/ui/views/App.style.js +0 -7
- package/pact.config.ts +0 -31
- package/pact.publish.js +0 -32
- package/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.ts +0 -62
- package/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.ts +0 -128
- package/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.ts +0 -63
- package/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.ts +0 -57
- package/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.ts +0 -57
- package/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.ts +0 -57
- package/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.ts +0 -63
- package/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.ts +0 -64
- package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.ts +0 -62
- package/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.ts +0 -136
- package/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.ts +0 -62
- package/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.ts +0 -62
- package/src/infrastructure/ui/views/App.style.ts +0 -9
package/.eslintrc.js
CHANGED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { CheckoutStatus } from "../../src/domain/checkout/model/checkout";
|
|
2
|
+
import { CheckoutItemStatus } from "../../src/domain/checkoutItem/model/checkoutItem";
|
|
3
|
+
import { bookedProductsVariants } from "../../src/infrastructure/projection/bookedProductsVariants/bookedProductsVariants.mock";
|
|
4
|
+
import { checkout } from "../../src/infrastructure/projection/checkout/checkout.mock";
|
|
5
|
+
import { checkoutItem } from "../../src/infrastructure/projection/checkoutItem/checkoutItem.mock";
|
|
6
|
+
import { checkoutQuestions } from "../../src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock";
|
|
7
|
+
import { paymentFlowPayload } from "../../src/infrastructure/projection/payment/paymentFlowPayload.mock";
|
|
8
|
+
import { pricing } from "../../src/infrastructure/projection/pricing/pricing.mock";
|
|
9
|
+
import { returnQuestions } from "../../src/infrastructure/projection/returnQuestion/returnQuestions.mock";
|
|
10
|
+
import { Routes } from "../../src/infrastructure/ui/routing/routes";
|
|
11
|
+
import { CheckoutQuestionType } from "../../src/projection/checkoutQuestion/checkoutQuestion";
|
|
12
|
+
import { interceptBlockCheckoutBooking } from "../support/interceptBlockCheckoutBooking";
|
|
13
|
+
import { interceptGiveCheckoutFeedback } from "../support/interceptGiveCheckoutFeedback";
|
|
14
|
+
import { interceptKeepCheckoutItem } from "../support/interceptKeepCheckoutItem";
|
|
15
|
+
import { interceptListCheckoutQuestionsByCheckoutId } from "../support/interceptListCheckoutQuestionsByCheckoutId";
|
|
16
|
+
import { interceptListReturnQuestionsByCheckoutItemId } from "../support/interceptListReturnQuestionsByCheckoutItemId";
|
|
17
|
+
import { interceptPayment } from "../support/interceptPayment";
|
|
18
|
+
import { interceptReplaceCheckoutItem } from "../support/interceptReplaceCheckoutItem";
|
|
19
|
+
import { interceptReturnCheckoutItem } from "../support/interceptReturnCheckoutItem";
|
|
20
|
+
import { interceptSubmitCheckout } from "../support/interceptSubmitCheckout";
|
|
21
|
+
import { interceptViewBookedProductsVariantsForCheckoutItem } from "../support/interceptViewBookedProductsVariantsForCheckoutItem";
|
|
22
|
+
import { interceptViewCheckoutById } from "../support/interceptViewCheckoutById";
|
|
23
|
+
import { interceptViewFirstAvailableCheckoutByCustomerId } from "../support/interceptViewFirstAvailableCheckoutByCustomerId";
|
|
24
|
+
import { interceptViewFiveItemsDiscountByCustomerId } from "../support/interceptViewFiveItemsDiscountByCustomerId";
|
|
25
|
+
import { interceptViewIsSizeChangeEnabledByCheckoutId } from "../support/interceptViewIsSizeChangeEnabledByCheckoutId";
|
|
26
|
+
import { interceptViewPaymentFlowPayloadByCheckoutId } from "../support/interceptViewPaymentFlowPayloadByCheckoutId";
|
|
27
|
+
import { interceptViewPricingByCheckoutId } from "../support/interceptViewPricingByCheckoutId";
|
|
28
|
+
|
|
29
|
+
const BASEPATH = "/checkout";
|
|
30
|
+
|
|
31
|
+
const checkoutProjection = checkout({
|
|
32
|
+
status: CheckoutStatus.STARTED,
|
|
33
|
+
items: [
|
|
34
|
+
{
|
|
35
|
+
status: CheckoutItemStatus.INITIAL,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
status: CheckoutItemStatus.INITIAL,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
status: CheckoutItemStatus.INITIAL,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
status: CheckoutItemStatus.INITIAL,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
status: CheckoutItemStatus.INITIAL,
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
});
|
|
51
|
+
const returnQuestionAnswers = [
|
|
52
|
+
["9251dc2c-d76a-484d-9299-346929af932f", "68c0bb98-b00a-4b86-af43-528fe903cb69"],
|
|
53
|
+
["56631448-d33d-49fb-b3f8-4486b68b60c3", "a3d937b6-7499-4a3c-86bf-5c0af9ab2e23"],
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
const randomIndex = (count: number) => Math.floor(Math.random() * count);
|
|
57
|
+
const navigateToHome = () => cy.visit("/");
|
|
58
|
+
const confirmCheckout = () => {
|
|
59
|
+
cy.shouldIncludePathInUrl(`${BASEPATH}/${Routes.CHECKOUT}`);
|
|
60
|
+
|
|
61
|
+
cy.getByTestId("confirm-checkout-button").click();
|
|
62
|
+
|
|
63
|
+
cy.shouldIncludePathInUrl(`${BASEPATH}/${Routes.CHECKOUT}/${Routes.CHECKOUT_PAYMENT}`);
|
|
64
|
+
|
|
65
|
+
interceptViewFirstAvailableCheckoutByCustomerId(
|
|
66
|
+
checkout({
|
|
67
|
+
status: CheckoutStatus.SUBMITTED,
|
|
68
|
+
items: checkoutProjection.items.map((item) =>
|
|
69
|
+
checkoutItem({
|
|
70
|
+
...item,
|
|
71
|
+
status: CheckoutItemStatus.KEPT,
|
|
72
|
+
}),
|
|
73
|
+
),
|
|
74
|
+
}),
|
|
75
|
+
).as("submittedViewFirstAvailableCheckoutByCustomerId");
|
|
76
|
+
|
|
77
|
+
cy.getByTestId("modal-notification-button").click();
|
|
78
|
+
cy.wait("@submitCheckout");
|
|
79
|
+
cy.wait("@submittedViewFirstAvailableCheckoutByCustomerId");
|
|
80
|
+
};
|
|
81
|
+
const checkoutFeedback = () => {
|
|
82
|
+
cy.shouldIncludePathInUrl(`${BASEPATH}/${Routes.FEEDBACK}`);
|
|
83
|
+
|
|
84
|
+
const answers = [];
|
|
85
|
+
checkoutQuestions.map((checkoutQuestion) => {
|
|
86
|
+
if (checkoutQuestion.children) {
|
|
87
|
+
const index = randomIndex(checkoutQuestion.children.length);
|
|
88
|
+
const randomCheckoutQuestionItem = checkoutQuestion.children[index];
|
|
89
|
+
answers.push(randomCheckoutQuestionItem.id);
|
|
90
|
+
|
|
91
|
+
if (
|
|
92
|
+
checkoutQuestion.showCondition.length === 0 ||
|
|
93
|
+
checkoutQuestion.showCondition.some((condition) => answers.includes(condition))
|
|
94
|
+
) {
|
|
95
|
+
if (checkoutQuestion.type === CheckoutQuestionType.HOST_TEXTAREA) {
|
|
96
|
+
cy.getByTestId(`${randomCheckoutQuestionItem.id}-input`).type("Cypress E2E test");
|
|
97
|
+
} else {
|
|
98
|
+
cy.getByTestId(`${randomCheckoutQuestionItem.id}`).click();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
interceptViewFirstAvailableCheckoutByCustomerId(
|
|
105
|
+
checkout({
|
|
106
|
+
status: CheckoutStatus.COMPLETED,
|
|
107
|
+
items: checkoutProjection.items.map((item) =>
|
|
108
|
+
checkoutItem({
|
|
109
|
+
...item,
|
|
110
|
+
status: CheckoutItemStatus.KEPT,
|
|
111
|
+
}),
|
|
112
|
+
),
|
|
113
|
+
}),
|
|
114
|
+
).as("completedViewFirstAvailableCheckoutByCustomerId");
|
|
115
|
+
|
|
116
|
+
cy.getByTestId("checkout-feedback-button").click();
|
|
117
|
+
cy.wait("@giveCheckoutFeedback");
|
|
118
|
+
cy.wait("@completedViewFirstAvailableCheckoutByCustomerId");
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
describe("Checkout", () => {
|
|
122
|
+
beforeEach(() => {
|
|
123
|
+
interceptViewFirstAvailableCheckoutByCustomerId(checkoutProjection);
|
|
124
|
+
interceptViewCheckoutById(checkoutProjection);
|
|
125
|
+
interceptViewIsSizeChangeEnabledByCheckoutId(true);
|
|
126
|
+
interceptViewFiveItemsDiscountByCustomerId(0);
|
|
127
|
+
interceptViewBookedProductsVariantsForCheckoutItem(bookedProductsVariants);
|
|
128
|
+
interceptListReturnQuestionsByCheckoutItemId(returnQuestions);
|
|
129
|
+
interceptViewPricingByCheckoutId(pricing());
|
|
130
|
+
interceptViewPaymentFlowPayloadByCheckoutId(paymentFlowPayload);
|
|
131
|
+
interceptListCheckoutQuestionsByCheckoutId(checkoutQuestions);
|
|
132
|
+
|
|
133
|
+
interceptKeepCheckoutItem();
|
|
134
|
+
interceptReplaceCheckoutItem();
|
|
135
|
+
interceptReturnCheckoutItem();
|
|
136
|
+
interceptBlockCheckoutBooking();
|
|
137
|
+
interceptPayment();
|
|
138
|
+
interceptSubmitCheckout().as("submitCheckout");
|
|
139
|
+
interceptGiveCheckoutFeedback().as("giveCheckoutFeedback");
|
|
140
|
+
|
|
141
|
+
navigateToHome();
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it("Keep checkout items", () => {
|
|
145
|
+
checkoutProjection.items.forEach((checkoutItemProjection, checkoutItemIndex) => {
|
|
146
|
+
cy.shouldIncludePathInUrl(checkoutItemProjection.id);
|
|
147
|
+
|
|
148
|
+
cy.getByTestId("keep-button").click();
|
|
149
|
+
|
|
150
|
+
const queryAlias = `viewFirstAvailableCheckoutByCustomerId_${checkoutItemProjection.id}`;
|
|
151
|
+
interceptViewFirstAvailableCheckoutByCustomerId(
|
|
152
|
+
checkout({
|
|
153
|
+
status: CheckoutStatus.STARTED,
|
|
154
|
+
items: checkoutProjection.items.map((item, index) =>
|
|
155
|
+
checkoutItem({
|
|
156
|
+
...item,
|
|
157
|
+
status: index <= checkoutItemIndex ? CheckoutItemStatus.KEPT : CheckoutItemStatus.INITIAL,
|
|
158
|
+
}),
|
|
159
|
+
),
|
|
160
|
+
}),
|
|
161
|
+
).as(queryAlias);
|
|
162
|
+
cy.wait(`@${queryAlias}`);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
cy.shouldIncludePathInUrl(`${BASEPATH}/${Routes.SUMMARY}`);
|
|
166
|
+
|
|
167
|
+
cy.getByTestId("keep-checkout-item").should("have.length", checkoutProjection.items.length);
|
|
168
|
+
cy.getByTestId("return-checkout-item").should("have.length", 0);
|
|
169
|
+
|
|
170
|
+
cy.getByTestId("submit-checkout-button").click();
|
|
171
|
+
|
|
172
|
+
confirmCheckout();
|
|
173
|
+
|
|
174
|
+
checkoutFeedback();
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
it("Replace checkout items", () => {
|
|
178
|
+
checkoutProjection.items.forEach((checkoutItemProjection, checkoutItemIndex) => {
|
|
179
|
+
cy.shouldIncludePathInUrl(checkoutItemProjection.id);
|
|
180
|
+
|
|
181
|
+
cy.getByTestId("size-selector").click();
|
|
182
|
+
|
|
183
|
+
const queryAlias = `viewFirstAvailableCheckoutByCustomerId_${checkoutItemProjection.id}`;
|
|
184
|
+
interceptViewFirstAvailableCheckoutByCustomerId(
|
|
185
|
+
checkout({
|
|
186
|
+
status: CheckoutStatus.STARTED,
|
|
187
|
+
items: checkoutProjection.items.map((item, index) =>
|
|
188
|
+
checkoutItem({
|
|
189
|
+
...item,
|
|
190
|
+
status: index <= checkoutItemIndex ? CheckoutItemStatus.REPLACED : CheckoutItemStatus.INITIAL,
|
|
191
|
+
}),
|
|
192
|
+
),
|
|
193
|
+
}),
|
|
194
|
+
).as(queryAlias);
|
|
195
|
+
|
|
196
|
+
const index = randomIndex(bookedProductsVariants.productVariants.length);
|
|
197
|
+
const randomBookedProductVariant = bookedProductsVariants.productVariants[index];
|
|
198
|
+
cy.getByTestId(randomBookedProductVariant.id).click();
|
|
199
|
+
|
|
200
|
+
cy.getByTestId("modal-notification-button").click();
|
|
201
|
+
|
|
202
|
+
cy.wait(`@${queryAlias}`);
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
cy.shouldIncludePathInUrl(`${BASEPATH}/${Routes.SUMMARY}`);
|
|
206
|
+
|
|
207
|
+
cy.getByTestId("keep-checkout-item").should("have.length", checkoutProjection.items.length);
|
|
208
|
+
cy.getByTestId("return-checkout-item").should("have.length", checkoutProjection.items.length);
|
|
209
|
+
|
|
210
|
+
cy.getByTestId("submit-checkout-button").click();
|
|
211
|
+
|
|
212
|
+
confirmCheckout();
|
|
213
|
+
|
|
214
|
+
checkoutFeedback();
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
it("Return checkout items", () => {
|
|
218
|
+
checkoutProjection.items.forEach((checkoutItemProjection, checkoutItemIndex) => {
|
|
219
|
+
cy.shouldIncludePathInUrl(checkoutItemProjection.id);
|
|
220
|
+
|
|
221
|
+
cy.getByTestId("return-button").click();
|
|
222
|
+
|
|
223
|
+
cy.shouldIncludePathInUrl(`${BASEPATH}/return`);
|
|
224
|
+
|
|
225
|
+
returnQuestionAnswers.forEach((returnQuestionAnswer) => {
|
|
226
|
+
returnQuestionAnswer.forEach((answer) => {
|
|
227
|
+
cy.getByTestId(answer).click().as("returnQuestionAnswers");
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
cy.getByTestId("return-questions-button").click();
|
|
232
|
+
|
|
233
|
+
const queryAlias = `viewFirstAvailableCheckoutByCustomerId_${checkoutItemProjection.id}`;
|
|
234
|
+
interceptViewFirstAvailableCheckoutByCustomerId(
|
|
235
|
+
checkout({
|
|
236
|
+
status: CheckoutStatus.STARTED,
|
|
237
|
+
items: checkoutProjection.items.map((item, index) =>
|
|
238
|
+
checkoutItem({
|
|
239
|
+
...item,
|
|
240
|
+
status: index <= checkoutItemIndex ? CheckoutItemStatus.RETURNED : CheckoutItemStatus.INITIAL,
|
|
241
|
+
}),
|
|
242
|
+
),
|
|
243
|
+
}),
|
|
244
|
+
).as(queryAlias);
|
|
245
|
+
cy.wait(`@${queryAlias}`);
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
cy.shouldIncludePathInUrl(`${BASEPATH}/${Routes.SUMMARY}`);
|
|
249
|
+
|
|
250
|
+
cy.getByTestId("keep-checkout-item").should("have.length", 0);
|
|
251
|
+
cy.getByTestId("return-checkout-item").should("have.length", checkoutProjection.items.length);
|
|
252
|
+
|
|
253
|
+
cy.getByTestId("submit-checkout-button").click();
|
|
254
|
+
|
|
255
|
+
confirmCheckout();
|
|
256
|
+
|
|
257
|
+
checkoutFeedback();
|
|
258
|
+
});
|
|
259
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CheckoutQuestionProjection } from "../../src/projection/checkoutQuestion/checkoutQuestion";
|
|
2
|
+
|
|
3
|
+
const interceptListCheckoutQuestionsByCheckoutId = (response: CheckoutQuestionProjection[]) =>
|
|
4
|
+
cy.intercept(
|
|
5
|
+
{ method: "POST", url: "/local-to-dev/list-checkout-questions-by-checkout-id" },
|
|
6
|
+
{ body: { result: response } },
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
export { interceptListCheckoutQuestionsByCheckoutId };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReturnQuestionProjection } from "../../src/projection/returnQuestion/returnQuestion";
|
|
2
|
+
|
|
3
|
+
const interceptListReturnQuestionsByCheckoutItemId = (response: ReturnQuestionProjection[]) =>
|
|
4
|
+
cy.intercept(
|
|
5
|
+
{ method: "POST", url: "/local-to-dev/list-return-questions-by-checkout-item-id" },
|
|
6
|
+
{ body: { result: response } },
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
export { interceptListReturnQuestionsByCheckoutItemId };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const interceptPayment = () =>
|
|
2
|
+
cy.intercept(
|
|
3
|
+
{ method: "POST", url: "/graphql" },
|
|
4
|
+
{
|
|
5
|
+
body: {
|
|
6
|
+
data: {
|
|
7
|
+
performCheckout: {
|
|
8
|
+
chargeExecution: {
|
|
9
|
+
chargeId: "7669b514-66b1-4adf-a91d-c948ce4c4d3d",
|
|
10
|
+
status: "EXECUTED",
|
|
11
|
+
metadata:
|
|
12
|
+
'{"intentId":"pi_3QIpjzGGj5moBHXu0D79lLS6","clientSecret":"pi_3QIpjzGGj5moBHXu0D79lLS6_secret_wnRLhdsN8ZIzvku9jrlgl6tKk","paymentInstrumentId":"689877fc-158d-49da-8f5e-22a8fca76b79","chargeId":"ch_3QIpjzGGj5moBHXu0KN6j3Cq"}',
|
|
13
|
+
declineCode: null,
|
|
14
|
+
},
|
|
15
|
+
errors: [],
|
|
16
|
+
result: true,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export { interceptPayment };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BookedProductsVariantsProjection } from "../../src/projection/bookedProductsVariants/bookedProductsVariants";
|
|
2
|
+
|
|
3
|
+
const interceptViewBookedProductsVariantsForCheckoutItem = (response: BookedProductsVariantsProjection) =>
|
|
4
|
+
cy.intercept(
|
|
5
|
+
{ method: "POST", url: "/local-to-dev/view-booked-product-variants-for-checkout-item" },
|
|
6
|
+
{ body: { result: response } },
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
export { interceptViewBookedProductsVariantsForCheckoutItem };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CheckoutProjection } from "../../src/projection/checkout/checkout";
|
|
2
|
+
|
|
3
|
+
const interceptViewCheckoutById = (response: CheckoutProjection) =>
|
|
4
|
+
cy.intercept({ method: "POST", url: "/local-to-dev/view-checkout-by-id" }, { body: { result: response } });
|
|
5
|
+
|
|
6
|
+
export { interceptViewCheckoutById };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CheckoutProjection } from "../../src/projection/checkout/checkout";
|
|
2
|
+
|
|
3
|
+
const interceptViewFirstAvailableCheckoutByCustomerId = (response: CheckoutProjection) =>
|
|
4
|
+
cy.intercept(
|
|
5
|
+
{ method: "POST", url: "/local-to-dev/view-first-available-checkout-by-customer-id" },
|
|
6
|
+
{ body: { result: response } },
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
export { interceptViewFirstAvailableCheckoutByCustomerId };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FiveItemsDiscountByCustomerIdProjection } from "../../src/projection/checkout/viewFiveItemsDiscountByCustomerId";
|
|
2
|
+
|
|
3
|
+
const interceptViewFiveItemsDiscountByCustomerId = (response: FiveItemsDiscountByCustomerIdProjection) =>
|
|
4
|
+
cy.intercept({ method: "GET", url: "/local-to-dev/view-five-items-discount-by-customer-id/*" }, { body: response });
|
|
5
|
+
|
|
6
|
+
export { interceptViewFiveItemsDiscountByCustomerId };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IsSizeChangeEnabledByCheckoutIdProjection } from "../../src/projection/checkout/viewIsSizeChangeEnabledByCheckoutId";
|
|
2
|
+
|
|
3
|
+
const interceptViewIsSizeChangeEnabledByCheckoutId = (response: IsSizeChangeEnabledByCheckoutIdProjection) =>
|
|
4
|
+
cy.intercept({ method: "GET", url: "/local-to-dev/is-size-change-enabled-by-checkout-id/*" }, { body: response });
|
|
5
|
+
|
|
6
|
+
export { interceptViewIsSizeChangeEnabledByCheckoutId };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PaymentFlowPayloadProjection } from "../../src/projection/payment/paymentFlowPayload";
|
|
2
|
+
|
|
3
|
+
const interceptViewPaymentFlowPayloadByCheckoutId = (response: PaymentFlowPayloadProjection) =>
|
|
4
|
+
cy.intercept(
|
|
5
|
+
{ method: "POST", url: "/local-to-dev/view-payment-flow-payload-by-checkout-id" },
|
|
6
|
+
{ body: { result: response } },
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
export { interceptViewPaymentFlowPayloadByCheckoutId };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PricingProjection } from "../../src/projection/pricing/pricing";
|
|
2
|
+
|
|
3
|
+
const interceptViewPricingByCheckoutId = (response: PricingProjection) =>
|
|
4
|
+
cy.intercept({ method: "POST", url: "/local-to-dev/view-pricing-by-checkout-id" }, { body: { result: response } });
|
|
5
|
+
|
|
6
|
+
export { interceptViewPricingByCheckoutId };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineConfig } from "cypress";
|
|
2
|
+
|
|
3
|
+
const webpack = require("webpack");
|
|
4
|
+
const expoWebpackConfig = require("./webpack.config");
|
|
5
|
+
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
projectId: "checkout",
|
|
8
|
+
fixturesFolder: "cypress/fixtures",
|
|
9
|
+
screenshotsFolder: "cypress/screenshots",
|
|
10
|
+
videosFolder: "cypress/videos",
|
|
11
|
+
viewportWidth: 1280,
|
|
12
|
+
viewportHeight: 720,
|
|
13
|
+
defaultCommandTimeout: 10000,
|
|
14
|
+
|
|
15
|
+
e2e: {
|
|
16
|
+
async setupNodeEvents(on, config) {
|
|
17
|
+
const webpackPreprocessor = require("@cypress/webpack-preprocessor");
|
|
18
|
+
const webpackOptions = await expoWebpackConfig(
|
|
19
|
+
{
|
|
20
|
+
pwa: false,
|
|
21
|
+
logger: {},
|
|
22
|
+
mode: "development",
|
|
23
|
+
https: false,
|
|
24
|
+
},
|
|
25
|
+
{},
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
on(
|
|
29
|
+
"file:preprocessor",
|
|
30
|
+
webpackPreprocessor({
|
|
31
|
+
webpackOptions: {
|
|
32
|
+
...webpackOptions,
|
|
33
|
+
plugins: [new webpack.DefinePlugin({ process: { env: {} } })],
|
|
34
|
+
},
|
|
35
|
+
}),
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
return config;
|
|
39
|
+
},
|
|
40
|
+
baseUrl: "http://localhost:19004/",
|
|
41
|
+
specPattern: "cypress/integration/**/*.{js,jsx,ts,tsx}",
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
component: {
|
|
45
|
+
devServer: {
|
|
46
|
+
framework: "react",
|
|
47
|
+
bundler: "webpack",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
});
|
package/dist/src/ExpoRoot.js
CHANGED
|
@@ -25,7 +25,7 @@ const order = {
|
|
|
25
25
|
coupon: "MYLOOKIERO",
|
|
26
26
|
};
|
|
27
27
|
const customer = {
|
|
28
|
-
customerId: "
|
|
28
|
+
customerId: "74cb4f76-3f14-4983-81a6-2ee2a9a275d4",
|
|
29
29
|
country: Country.ES,
|
|
30
30
|
segment: Segment.WOMEN,
|
|
31
31
|
};
|
|
@@ -36,7 +36,7 @@ const sentryConfig = {
|
|
|
36
36
|
environment: `${Platform.OS}-EXPO`,
|
|
37
37
|
};
|
|
38
38
|
const apiUrl = Platform.OS !== "web" ? "https://web2.sp.dev.aws.lookiero.es/quiz/api" : __DEV__ ? "/local-to-dev" : "/checkout/api";
|
|
39
|
-
const authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.
|
|
39
|
+
const authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjU2NDg3OTAsImV4cCI6MTczNDAwNTE4MywiZGlzcGxheU5hbWUiOiJUZXN0aW5nIiwiY291bnRyeV9jb2RlIjoiRVMiLCJhY2Nlc3NWaWEiOiJlbWFpbCIsInN1YnNjcmlwdGlvblN0YXJ0aW5nRGF0ZSI6IjIwMjQtMTEtMDgiLCJpbXBlcnNvbmF0ZWQiOmZhbHNlLCJ1dWlkIjoiNzRjYjRmNzYtM2YxNC00OTgzLTgxYTYtMmVlMmE5YTI3NWQ0IiwiaWF0IjoxNzMxNDEzMTgzfQ.KU6RhR19P6FhbH-lad-Hyx2PP1pv25GaDiE2txK9LMI";
|
|
40
40
|
const getAuthToken = () => Promise.resolve(authToken);
|
|
41
41
|
const externalTranslationsUrl = Platform.OS !== "web"
|
|
42
42
|
? "https://backend-for-user.dev.envs.lookiero.tech/api/v2/translations"
|
package/dist/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.js
CHANGED
|
@@ -13,6 +13,6 @@ const useViewPaymentFlowPayloadByCheckoutId = ({ checkoutId }) => useQuery({
|
|
|
13
13
|
query: viewPaymentFlowPayloadByCheckoutId({ checkoutId: checkoutId }),
|
|
14
14
|
contextId: MESSAGING_CONTEXT_ID,
|
|
15
15
|
invalidation: shouldInvalidate,
|
|
16
|
-
options: { refetchOnMount: "always", enabled: Boolean(checkoutId), cacheTime: 0 },
|
|
16
|
+
options: { refetchOnMount: "always", enabled: Boolean(checkoutId), cacheTime: 0, refetchOnWindowFocus: false },
|
|
17
17
|
});
|
|
18
18
|
export { useViewPaymentFlowPayloadByCheckoutId };
|
|
@@ -9,7 +9,6 @@ import { Customer } from "../../projection/customer/customer";
|
|
|
9
9
|
import { Order } from "../../projection/order/order";
|
|
10
10
|
import { Subscription } from "../../projection/subscription/subscription";
|
|
11
11
|
import { KameleoonEnvironment } from "../ab-testing/kameleoonEnvironment";
|
|
12
|
-
import { RoutingStyle } from "./routing/Routing";
|
|
13
12
|
interface RootFunctionArgs {
|
|
14
13
|
readonly Messaging: MessagingRoot;
|
|
15
14
|
readonly I18n: I18n;
|
|
@@ -28,7 +27,6 @@ interface RootProps {
|
|
|
28
27
|
readonly order: Order | undefined;
|
|
29
28
|
readonly subscription: Subscription | undefined;
|
|
30
29
|
readonly layout: Layout;
|
|
31
|
-
readonly style?: Partial<RoutingStyle>;
|
|
32
30
|
readonly onNotAccessible: () => void;
|
|
33
31
|
readonly onCheckoutSubmitted?: () => void;
|
|
34
32
|
readonly useRedirect: () => Record<string, string>;
|
|
@@ -9,10 +9,10 @@ const root = ({ Messaging, I18n, getAuthToken, development, sentry, kameleoon: k
|
|
|
9
9
|
const logger = sentryLogger(sentry);
|
|
10
10
|
const kameleoon = kameleoonConfig();
|
|
11
11
|
// eslint-disable-next-line react/display-name, react/prop-types
|
|
12
|
-
const Root = ({ basePath, locale = Locale.en_GB, customer, order, subscription, layout,
|
|
12
|
+
const Root = ({ basePath, locale = Locale.en_GB, customer, order, subscription, layout, onNotAccessible, onCheckoutSubmitted, useRedirect, useRoutes = reactRouterUseRoutes, }) => {
|
|
13
13
|
const handleOnI18nError = useCallback((error) => logger.captureException(error), []);
|
|
14
14
|
return (React.createElement(Messaging, { includeReactQueryDevTools: Platform.OS === "web" },
|
|
15
|
-
React.createElement(Routing, { I18n: I18n, basePath: basePath, customer: customer, getAuthToken: getAuthToken, kameleoon: kameleoon, layout: layout, locale: locale, order: order,
|
|
15
|
+
React.createElement(Routing, { I18n: I18n, basePath: basePath, customer: customer, getAuthToken: getAuthToken, kameleoon: kameleoon, layout: layout, locale: locale, order: order, subscription: subscription, useRedirect: useRedirect, useRoutes: useRoutes, onCheckoutSubmitted: onCheckoutSubmitted, onI18nError: development ? undefined : handleOnI18nError, onNotAccessible: onNotAccessible })));
|
|
16
16
|
};
|
|
17
17
|
const hoc = sentryLoggerHOC({ logger });
|
|
18
18
|
/**
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
2
|
import { ReturnQuestionProjection } from "../../../../../projection/returnQuestion/returnQuestion";
|
|
4
|
-
interface ReturnQuestionStyle {
|
|
5
|
-
readonly modal: StyleProp<ViewStyle>;
|
|
6
|
-
}
|
|
7
3
|
interface ReturnQuestionProps {
|
|
8
4
|
readonly returnQuestionParent: ReturnQuestionProjection;
|
|
9
5
|
readonly returnQuestion: ReturnQuestionProjection;
|
|
10
6
|
readonly portalHostName?: string;
|
|
11
|
-
readonly style?: Partial<ReturnQuestionStyle>;
|
|
12
7
|
}
|
|
13
8
|
declare const _default: React.NamedExoticComponent<ReturnQuestionProps>;
|
|
14
9
|
export default _default;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React, { memo } from "react";
|
|
2
|
+
import { returnQuestionHasChildren } from "../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
2
3
|
import { useReturnQuestionItem } from "./behaviors/useReturnQuestionItem";
|
|
3
|
-
const ReturnQuestion = ({ returnQuestionParent, returnQuestion, portalHostName
|
|
4
|
+
const ReturnQuestion = ({ returnQuestionParent, returnQuestion, portalHostName }) => {
|
|
4
5
|
const Item = useReturnQuestionItem({ type: returnQuestion.type });
|
|
5
|
-
return (React.createElement(Item, { portalHostName: portalHostName, returnQuestion: returnQuestion, returnQuestionParent: returnQuestionParent,
|
|
6
|
-
React.createElement(React.Fragment, null, returnQuestion
|
|
6
|
+
return (React.createElement(Item, { portalHostName: portalHostName, returnQuestion: returnQuestion, returnQuestionParent: returnQuestionParent, testID: returnQuestion.id },
|
|
7
|
+
React.createElement(React.Fragment, null, returnQuestionHasChildren(returnQuestion) &&
|
|
8
|
+
returnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, portalHostName: portalHostName, returnQuestion: childReturnQuestion, returnQuestionParent: returnQuestion }))))));
|
|
7
9
|
};
|
|
8
10
|
export default memo(ReturnQuestion);
|
package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.d.ts
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
2
|
import { ReturnQuestionProjection } from "../../../../../projection/returnQuestion/returnQuestion";
|
|
4
|
-
interface ReturnQuestionsStyle {
|
|
5
|
-
readonly modal: StyleProp<ViewStyle>;
|
|
6
|
-
}
|
|
7
3
|
interface ReturnQuestionsProps {
|
|
8
4
|
readonly returnQuestions: ReturnQuestionProjection[];
|
|
9
5
|
readonly portalHostName?: string;
|
|
10
|
-
readonly style?: Partial<ReturnQuestionsStyle>;
|
|
11
6
|
}
|
|
12
7
|
declare const ReturnQuestions: FC<ReturnQuestionsProps>;
|
|
13
8
|
export { ReturnQuestions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import ReturnQuestion from "./ReturnQuestion";
|
|
3
|
-
const ReturnQuestions = ({ returnQuestions, portalHostName
|
|
3
|
+
const ReturnQuestions = ({ returnQuestions, portalHostName }) => (React.createElement(React.Fragment, null, returnQuestions.map((returnQuestion) => (React.createElement(ReturnQuestion, { key: returnQuestion.id, portalHostName: portalHostName, returnQuestion: returnQuestion, returnQuestionParent: {} })))));
|
|
4
4
|
export { ReturnQuestions };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { returnQuestionHasChildren } from "../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
1
2
|
const isChildReturnQuestion = ({ returnQuestionId, returnQuestion }) => {
|
|
2
3
|
if (returnQuestionId === returnQuestion.id) {
|
|
3
4
|
return true;
|
|
4
5
|
}
|
|
5
|
-
const children = returnQuestion.children || [];
|
|
6
|
+
const children = (returnQuestionHasChildren(returnQuestion) && returnQuestion.children) || [];
|
|
6
7
|
for (let index = 0; index < children.length; index++) {
|
|
7
8
|
const isChild = isChildReturnQuestion({
|
|
8
9
|
returnQuestionId,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC, ReactNode } from "react";
|
|
2
|
-
import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
2
|
+
import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
3
3
|
import { ReturnQuestionItem } from "../components/ReturnQuestionItem";
|
|
4
|
-
type ReturnQuestionItems = Record<ReturnQuestionType, ReturnQuestionItem
|
|
4
|
+
type ReturnQuestionItems = Record<ReturnQuestionType, ReturnQuestionItem<ReturnQuestionType>>;
|
|
5
5
|
interface ReturnQuestionItemContextProviderProps {
|
|
6
6
|
readonly returnQuestionItems: ReturnQuestionItems;
|
|
7
7
|
readonly children: ReactNode;
|
|
@@ -11,7 +11,7 @@ interface UseReturnQuestionItemFunctionArgs {
|
|
|
11
11
|
readonly type: ReturnQuestionType;
|
|
12
12
|
}
|
|
13
13
|
interface UseReturnQuestionItemFunction {
|
|
14
|
-
(args: UseReturnQuestionItemFunctionArgs): ReturnQuestionItem
|
|
14
|
+
(args: UseReturnQuestionItemFunctionArgs): ReturnQuestionItem<ReturnQuestionType>;
|
|
15
15
|
}
|
|
16
16
|
declare const useReturnQuestionItem: UseReturnQuestionItemFunction;
|
|
17
17
|
export type { ReturnQuestionItems };
|