@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
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Text } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
ReturnQuestionType,
|
|
6
|
-
} from "../../../../../../../../projection/returnQuestion/returnQuestion";
|
|
3
|
+
import { ReturnQuestionProjection } from "../../../../../../../../projection/returnQuestion/returnQuestion";
|
|
4
|
+
import { ReturnQuestionType } from "../../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
7
5
|
import { render } from "../../../../../../test/render";
|
|
8
6
|
import * as useReturnQuestionFeedback from "../../../behaviors/useReturnQuestionFeedback";
|
|
9
7
|
import { HostStackReturnQuestionItem } from "./HostStackReturnQuestionItem";
|
|
@@ -15,45 +13,54 @@ const mockedUseReturnQuestionFeedbackForReturnQuestion = (
|
|
|
15
13
|
useReturnQuestionFeedback as jest.Mocked<typeof useReturnQuestionFeedback>
|
|
16
14
|
).useReturnQuestionFeedbackForReturnQuestion;
|
|
17
15
|
|
|
18
|
-
const
|
|
19
|
-
{
|
|
20
|
-
id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
|
|
21
|
-
name: "size_overall",
|
|
22
|
-
placeholder: "",
|
|
23
|
-
type: ReturnQuestionType.OPTION,
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
id: "85e84a77-461c-41e6-8544-95b5294d0b80",
|
|
27
|
-
name: "size_trousers_too_long",
|
|
28
|
-
placeholder: "",
|
|
29
|
-
type: ReturnQuestionType.OPTION,
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
id: "29441d25-8d9f-471e-a13e-a03f61c88091",
|
|
33
|
-
name: "size_fit_cut_does_not_fit",
|
|
34
|
-
placeholder: "",
|
|
35
|
-
type: ReturnQuestionType.OPTION,
|
|
36
|
-
},
|
|
37
|
-
];
|
|
38
|
-
|
|
39
|
-
const withTitle: ReturnQuestionProjection = {
|
|
16
|
+
const withTitle: ReturnQuestionProjection<ReturnQuestionType.HOST_STACK> = {
|
|
40
17
|
id: "542c4d24-e1da-484f-8c3a-7d89ee135adc",
|
|
41
|
-
|
|
42
|
-
placeholder: "",
|
|
18
|
+
translationKey: "return question title",
|
|
43
19
|
type: ReturnQuestionType.HOST_STACK,
|
|
44
|
-
children:
|
|
20
|
+
children: [
|
|
21
|
+
{
|
|
22
|
+
id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
|
|
23
|
+
translationKey: "size_overall",
|
|
24
|
+
type: ReturnQuestionType.OPTION,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "85e84a77-461c-41e6-8544-95b5294d0b80",
|
|
28
|
+
translationKey: "size_trousers_too_long",
|
|
29
|
+
type: ReturnQuestionType.OPTION,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "29441d25-8d9f-471e-a13e-a03f61c88091",
|
|
33
|
+
translationKey: "size_fit_cut_does_not_fit",
|
|
34
|
+
type: ReturnQuestionType.OPTION,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
45
37
|
};
|
|
46
38
|
|
|
47
|
-
const withoutTitle: ReturnQuestionProjection = {
|
|
39
|
+
const withoutTitle: ReturnQuestionProjection<ReturnQuestionType.HOST_STACK> = {
|
|
48
40
|
id: "542c4d24-e1da-484f-8c3a-7d89ee135adc",
|
|
49
|
-
|
|
50
|
-
placeholder: "",
|
|
41
|
+
translationKey: "",
|
|
51
42
|
type: ReturnQuestionType.HOST_STACK,
|
|
52
|
-
children:
|
|
43
|
+
children: [
|
|
44
|
+
{
|
|
45
|
+
id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
|
|
46
|
+
translationKey: "size_overall",
|
|
47
|
+
type: ReturnQuestionType.OPTION,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "85e84a77-461c-41e6-8544-95b5294d0b80",
|
|
51
|
+
translationKey: "size_trousers_too_long",
|
|
52
|
+
type: ReturnQuestionType.OPTION,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: "29441d25-8d9f-471e-a13e-a03f61c88091",
|
|
56
|
+
translationKey: "size_fit_cut_does_not_fit",
|
|
57
|
+
type: ReturnQuestionType.OPTION,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
53
60
|
};
|
|
54
61
|
|
|
55
62
|
interface RenderHostStackReturnQuestionItemParameters {
|
|
56
|
-
readonly returnQuestion: ReturnQuestionProjection
|
|
63
|
+
readonly returnQuestion: ReturnQuestionProjection<ReturnQuestionType.HOST_STACK>;
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
const renderHostStackReturnQuestionItem = ({ returnQuestion }: RenderHostStackReturnQuestionItemParameters) =>
|
|
@@ -72,7 +79,7 @@ describe("HostStackReturnQuestionItem component (ReturnQuestions organism)", ()
|
|
|
72
79
|
});
|
|
73
80
|
const { findByText } = renderHostStackReturnQuestionItem({ returnQuestion: withTitle });
|
|
74
81
|
|
|
75
|
-
expect(await findByText(withTitle.
|
|
82
|
+
expect(await findByText(withTitle.translationKey as string)).toBeDefined();
|
|
76
83
|
});
|
|
77
84
|
|
|
78
85
|
it("does not render a title for the returnQuestion (when returnQuestion's name is not provided)", async () => {
|
|
@@ -83,7 +90,7 @@ describe("HostStackReturnQuestionItem component (ReturnQuestions organism)", ()
|
|
|
83
90
|
});
|
|
84
91
|
const { queryByText } = renderHostStackReturnQuestionItem({ returnQuestion: withoutTitle });
|
|
85
92
|
|
|
86
|
-
expect(await queryByText(withTitle.
|
|
93
|
+
expect(await queryByText(withTitle.translationKey as string)).toBeNull();
|
|
87
94
|
});
|
|
88
95
|
|
|
89
96
|
it("renders the feedback and a ReturnQuestion for its returnQuestion.children when there is feedback", async () => {
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import { animated, useSpring } from "@react-spring/native";
|
|
2
3
|
import React, { useCallback, useMemo, useState } from "react";
|
|
3
4
|
import { LayoutChangeEvent, View } from "react-native";
|
|
4
5
|
import { COLOR, Text } from "@lookiero/aurora";
|
|
5
6
|
import { useIntl } from "@lookiero/i18n-react";
|
|
7
|
+
import { ReturnQuestionType } from "../../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
8
|
+
import { returnQuestionHasChildren } from "../../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
6
9
|
import ReturnQuestion from "../../../ReturnQuestion";
|
|
7
10
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../../behaviors/useReturnQuestionFeedback";
|
|
8
|
-
import { ReturnQuestionItem
|
|
11
|
+
import { ReturnQuestionItem } from "../../ReturnQuestionItem";
|
|
9
12
|
import { style } from "./HostStackReturnQuestionItem.style";
|
|
10
13
|
|
|
11
|
-
const HostStackReturnQuestionItem: ReturnQuestionItem = ({
|
|
14
|
+
const HostStackReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_STACK> = ({
|
|
12
15
|
returnQuestion,
|
|
13
16
|
children,
|
|
14
17
|
portalHostName,
|
|
15
|
-
|
|
16
|
-
}: ReturnQuestionItemProps) => {
|
|
18
|
+
}) => {
|
|
17
19
|
const { formatMessage } = useIntl();
|
|
18
20
|
const { feedback } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion });
|
|
19
21
|
const feedbackReturnQuestion = feedback
|
|
@@ -21,11 +23,11 @@ const HostStackReturnQuestionItem: ReturnQuestionItem = ({
|
|
|
21
23
|
: undefined;
|
|
22
24
|
|
|
23
25
|
const titleText = useMemo(
|
|
24
|
-
() => (returnQuestion.
|
|
25
|
-
[formatMessage, returnQuestion.
|
|
26
|
+
() => (returnQuestion.translationKey ? formatMessage({ id: returnQuestion.translationKey }) : undefined),
|
|
27
|
+
[formatMessage, returnQuestion.translationKey],
|
|
26
28
|
);
|
|
27
29
|
const feedbackText = useMemo(
|
|
28
|
-
() => (feedbackReturnQuestion ? formatMessage({ id: feedbackReturnQuestion.
|
|
30
|
+
() => (feedbackReturnQuestion ? formatMessage({ id: feedbackReturnQuestion.translationKey }) : undefined),
|
|
29
31
|
[feedbackReturnQuestion, formatMessage],
|
|
30
32
|
);
|
|
31
33
|
|
|
@@ -49,7 +51,7 @@ const HostStackReturnQuestionItem: ReturnQuestionItem = ({
|
|
|
49
51
|
{titleText}
|
|
50
52
|
</Text>
|
|
51
53
|
)}
|
|
52
|
-
{feedbackReturnQuestion ? (
|
|
54
|
+
{feedbackReturnQuestion && returnQuestionHasChildren(feedbackReturnQuestion) ? (
|
|
53
55
|
<>
|
|
54
56
|
<Text color={COLOR.TEXT_MEDIUM} level={3}>
|
|
55
57
|
{feedbackText}
|
|
@@ -60,7 +62,6 @@ const HostStackReturnQuestionItem: ReturnQuestionItem = ({
|
|
|
60
62
|
portalHostName={portalHostName}
|
|
61
63
|
returnQuestion={childReturnQuestion}
|
|
62
64
|
returnQuestionParent={feedbackReturnQuestion}
|
|
63
|
-
style={customStyle}
|
|
64
65
|
/>
|
|
65
66
|
))}
|
|
66
67
|
</>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { View } from "react-native";
|
|
3
3
|
import { COLOR, Text } from "@lookiero/aurora";
|
|
4
4
|
import { useIntl } from "@lookiero/i18n-react";
|
|
5
5
|
import { Modal } from "@lookiero/sty-psp-ui";
|
|
6
6
|
import { ReturnQuestionProjection } from "../../../../../../../projection/returnQuestion/returnQuestion";
|
|
7
|
+
import { returnQuestionHasChildren } from "../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
7
8
|
import ReturnQuestion from "../../ReturnQuestion";
|
|
8
9
|
import { style } from "./ModalOptionReturnQuestionItems.style";
|
|
9
10
|
|
|
@@ -12,7 +13,6 @@ interface ModalOptionReturnQuestionItemsProps {
|
|
|
12
13
|
readonly returnQuestion: ReturnQuestionProjection;
|
|
13
14
|
readonly returnQuestionParent: ReturnQuestionProjection;
|
|
14
15
|
readonly visible: boolean;
|
|
15
|
-
readonly style?: StyleProp<ViewStyle>;
|
|
16
16
|
readonly onClose: () => void;
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -20,28 +20,27 @@ const ModalOptionReturnQuestionItems = ({
|
|
|
20
20
|
portalHostName,
|
|
21
21
|
returnQuestion,
|
|
22
22
|
visible,
|
|
23
|
-
style: customStyle,
|
|
24
23
|
onClose,
|
|
25
24
|
}: ModalOptionReturnQuestionItemsProps) => {
|
|
26
25
|
const { formatMessage } = useIntl();
|
|
27
|
-
const title = formatMessage({ id: returnQuestion.
|
|
26
|
+
const title = formatMessage({ id: returnQuestion.translationKey });
|
|
28
27
|
|
|
29
28
|
return (
|
|
30
29
|
<Modal portalHostName={portalHostName} visible={visible} scroll showCloseButton onClose={onClose}>
|
|
31
|
-
<View style={
|
|
30
|
+
<View style={style.modalContent}>
|
|
32
31
|
<Text color={COLOR.TEXT_MEDIUM} level={2} style={style.optionText}>
|
|
33
32
|
{title}
|
|
34
33
|
</Text>
|
|
35
34
|
<>
|
|
36
|
-
{returnQuestion
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
{returnQuestionHasChildren(returnQuestion) &&
|
|
36
|
+
returnQuestion.children?.map((childReturnQuestion) => (
|
|
37
|
+
<ReturnQuestion
|
|
38
|
+
key={childReturnQuestion.id}
|
|
39
|
+
portalHostName=""
|
|
40
|
+
returnQuestion={childReturnQuestion}
|
|
41
|
+
returnQuestionParent={returnQuestion}
|
|
42
|
+
/>
|
|
43
|
+
))}
|
|
45
44
|
</>
|
|
46
45
|
</View>
|
|
47
46
|
</Modal>
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { fireEvent } from "@testing-library/react-native";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
ReturnQuestionType,
|
|
6
|
-
} from "../../../../../../../projection/returnQuestion/returnQuestion";
|
|
3
|
+
import { ReturnQuestionProjection } from "../../../../../../../projection/returnQuestion/returnQuestion";
|
|
4
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
7
5
|
import { render } from "../../../../../test/render";
|
|
8
6
|
import { OptionReturnQuestionItem } from "./OptionReturnQuestionItem";
|
|
9
7
|
|
|
@@ -17,26 +15,22 @@ const returnQuestionParent = {
|
|
|
17
15
|
} as ReturnQuestionProjection;
|
|
18
16
|
const returnQuestion: ReturnQuestionProjection = {
|
|
19
17
|
id: "9251dc2c-d76a-484d-9299-346929af932f",
|
|
20
|
-
|
|
21
|
-
placeholder: "",
|
|
18
|
+
translationKey: "size_large",
|
|
22
19
|
type: ReturnQuestionType.OPTION,
|
|
23
20
|
children: [
|
|
24
21
|
{
|
|
25
22
|
id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
|
|
26
|
-
|
|
27
|
-
placeholder: "",
|
|
23
|
+
translationKey: "size_overall",
|
|
28
24
|
type: ReturnQuestionType.OPTION,
|
|
29
25
|
},
|
|
30
26
|
{
|
|
31
27
|
id: "85e84a77-461c-41e6-8544-95b5294d0b80",
|
|
32
|
-
|
|
33
|
-
placeholder: "",
|
|
28
|
+
translationKey: "size_trousers_too_long",
|
|
34
29
|
type: ReturnQuestionType.OPTION,
|
|
35
30
|
},
|
|
36
31
|
{
|
|
37
32
|
id: "29441d25-8d9f-471e-a13e-a03f61c88091",
|
|
38
|
-
|
|
39
|
-
placeholder: "",
|
|
33
|
+
translationKey: "size_fit_cut_does_not_fit",
|
|
40
34
|
type: ReturnQuestionType.OPTION,
|
|
41
35
|
},
|
|
42
36
|
],
|
|
@@ -48,9 +42,9 @@ describe("OptionReturnQuestionItem component (ReturnQuestions organism)", () =>
|
|
|
48
42
|
<OptionReturnQuestionItem returnQuestion={returnQuestion} returnQuestionParent={returnQuestionParent} />,
|
|
49
43
|
);
|
|
50
44
|
|
|
51
|
-
expect(getByText(returnQuestion.
|
|
45
|
+
expect(getByText(returnQuestion.translationKey)).toBeTruthy();
|
|
52
46
|
|
|
53
|
-
fireEvent.press(getByText(returnQuestion.
|
|
47
|
+
fireEvent.press(getByText(returnQuestion.translationKey));
|
|
54
48
|
|
|
55
49
|
expect(mockOnChange).toHaveBeenCalledWith({
|
|
56
50
|
returnQuestionId: returnQuestionParent.id,
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React, { useCallback } from "react";
|
|
2
3
|
import { TouchableHighlight, ViewStyle } from "react-native";
|
|
3
4
|
import { Text } from "@lookiero/aurora";
|
|
4
5
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
6
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
5
7
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../behaviors/useReturnQuestionFeedback";
|
|
6
|
-
import { ReturnQuestionItem
|
|
8
|
+
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
7
9
|
import { containerUnderlayColor, style } from "./OptionReturnQuestionItem.style";
|
|
8
10
|
|
|
9
|
-
const OptionReturnQuestionItem: ReturnQuestionItem = ({
|
|
11
|
+
const OptionReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.OPTION> = ({
|
|
10
12
|
returnQuestion,
|
|
11
13
|
returnQuestionParent,
|
|
12
14
|
testID,
|
|
13
|
-
}
|
|
15
|
+
}) => {
|
|
14
16
|
const { onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
15
17
|
|
|
16
|
-
const optionText = useI18nMessage({ id: returnQuestion.
|
|
18
|
+
const optionText = useI18nMessage({ id: returnQuestion.translationKey });
|
|
17
19
|
const handleOnPress = useCallback(
|
|
18
20
|
() => onChange({ returnQuestionId: returnQuestionParent.id, returnQuestionFeedback: returnQuestion.id }),
|
|
19
21
|
[onChange, returnQuestion.id, returnQuestionParent.id],
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React, { useCallback, useEffect, useState } from "react";
|
|
2
|
-
import { View, Option, OPTION_VARIANT } from "@lookiero/aurora";
|
|
3
|
+
import { View, Option, OPTION_VARIANT, SIZE } from "@lookiero/aurora";
|
|
3
4
|
import { useIntl } from "@lookiero/i18n-react";
|
|
5
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
4
6
|
import {
|
|
5
7
|
useReturnQuestionFeedback,
|
|
6
8
|
useReturnQuestionFeedbackForReturnQuestion,
|
|
@@ -9,17 +11,16 @@ import {
|
|
|
9
11
|
deepestReturnQuestionWithFeedbackForReturnQuestion,
|
|
10
12
|
feedbackForReturnQuestion,
|
|
11
13
|
} from "../../util/returnQuestionFeedback";
|
|
12
|
-
import { ReturnQuestionItem
|
|
14
|
+
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
13
15
|
import { ModalOptionReturnQuestionItems } from "../modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems";
|
|
14
16
|
import { style } from "./RadioReturnQuestionItem.style";
|
|
15
17
|
|
|
16
|
-
const RadioReturnQuestionItem: ReturnQuestionItem = ({
|
|
18
|
+
const RadioReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.OPTION> = ({
|
|
17
19
|
returnQuestion,
|
|
18
20
|
returnQuestionParent,
|
|
19
21
|
testID,
|
|
20
22
|
portalHostName,
|
|
21
|
-
|
|
22
|
-
}: ReturnQuestionItemProps) => {
|
|
23
|
+
}) => {
|
|
23
24
|
const intl = useIntl();
|
|
24
25
|
const [modalVisible, setModalVisible] = useState(false);
|
|
25
26
|
const {
|
|
@@ -34,7 +35,7 @@ const RadioReturnQuestionItem: ReturnQuestionItem = ({
|
|
|
34
35
|
);
|
|
35
36
|
|
|
36
37
|
const inputValue = feedbackForReturnQuestion({ feedback, returnQuestion, translate }).join(" / ");
|
|
37
|
-
const optionText = intl.formatMessage({ id: returnQuestion.
|
|
38
|
+
const optionText = intl.formatMessage({ id: returnQuestion.translationKey });
|
|
38
39
|
|
|
39
40
|
const hasChildren = Boolean(returnQuestion.children && returnQuestion.children.length > 0);
|
|
40
41
|
|
|
@@ -75,6 +76,7 @@ const RadioReturnQuestionItem: ReturnQuestionItem = ({
|
|
|
75
76
|
<View style={style.wrapper} testID={testID}>
|
|
76
77
|
<Option
|
|
77
78
|
checked={returnQuestion.id === feedbackId}
|
|
79
|
+
flex={SIZE.XS}
|
|
78
80
|
name={returnQuestion.id}
|
|
79
81
|
title={inputValue ? `${optionText} / ${inputValue}` : `${optionText}`}
|
|
80
82
|
value={returnQuestion.id}
|
|
@@ -87,7 +89,6 @@ const RadioReturnQuestionItem: ReturnQuestionItem = ({
|
|
|
87
89
|
portalHostName={portalHostName}
|
|
88
90
|
returnQuestion={returnQuestion}
|
|
89
91
|
returnQuestionParent={returnQuestion}
|
|
90
|
-
style={customStyle?.modal}
|
|
91
92
|
visible={modalVisible}
|
|
92
93
|
onClose={handleOnModalClose}
|
|
93
94
|
/>
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
ReturnQuestionType,
|
|
5
|
-
} from "../../../../../../../projection/returnQuestion/returnQuestion";
|
|
2
|
+
import { ReturnQuestionProjection } from "../../../../../../../projection/returnQuestion/returnQuestion";
|
|
3
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
6
4
|
import { feedback as mockFeedback } from "../../../../../../projection/feedback/feedback.mock";
|
|
7
5
|
import { I18nMessages } from "../../../../../i18n/i18n";
|
|
8
6
|
import { render } from "../../../../../test/render";
|
|
@@ -12,40 +10,34 @@ jest.mock("../../behaviors/useReturnQuestionFeedback", () => ({
|
|
|
12
10
|
useReturnQuestionFeedback: () => mockFeedback,
|
|
13
11
|
}));
|
|
14
12
|
|
|
15
|
-
const returnQuestion: ReturnQuestionProjection = {
|
|
13
|
+
const returnQuestion: ReturnQuestionProjection<ReturnQuestionType.HOST_DEFAULT> = {
|
|
16
14
|
id: "0ad1dba8-b02c-4121-a1e3-981f1c30800d",
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
type: ReturnQuestionType.HOST_STACK,
|
|
15
|
+
translationKey: "size_title",
|
|
16
|
+
type: ReturnQuestionType.HOST_DEFAULT,
|
|
20
17
|
children: [
|
|
21
18
|
{
|
|
22
19
|
id: "9251dc2c-d76a-484d-9299-346929af932f",
|
|
23
|
-
|
|
24
|
-
placeholder: "",
|
|
20
|
+
translationKey: "size_large",
|
|
25
21
|
type: ReturnQuestionType.OPTION,
|
|
26
22
|
children: [
|
|
27
23
|
{
|
|
28
24
|
id: "542c4d24-e1da-484f-8c3a-7d89ee135adc",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
type: ReturnQuestionType.HOST_STACK,
|
|
25
|
+
translationKey: "",
|
|
26
|
+
type: ReturnQuestionType.HOST_DEFAULT,
|
|
32
27
|
children: [
|
|
33
28
|
{
|
|
34
29
|
id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
|
|
35
|
-
|
|
36
|
-
placeholder: "",
|
|
30
|
+
translationKey: "size_overall",
|
|
37
31
|
type: ReturnQuestionType.OPTION,
|
|
38
32
|
},
|
|
39
33
|
{
|
|
40
34
|
id: "85e84a77-461c-41e6-8544-95b5294d0b80",
|
|
41
|
-
|
|
42
|
-
placeholder: "",
|
|
35
|
+
translationKey: "size_trousers_too_long",
|
|
43
36
|
type: ReturnQuestionType.OPTION,
|
|
44
37
|
},
|
|
45
38
|
{
|
|
46
39
|
id: "29441d25-8d9f-471e-a13e-a03f61c88091",
|
|
47
|
-
|
|
48
|
-
placeholder: "",
|
|
40
|
+
translationKey: "size_fit_cut_does_not_fit",
|
|
49
41
|
type: ReturnQuestionType.OPTION,
|
|
50
42
|
},
|
|
51
43
|
],
|
|
@@ -54,11 +46,17 @@ const returnQuestion: ReturnQuestionProjection = {
|
|
|
54
46
|
},
|
|
55
47
|
],
|
|
56
48
|
};
|
|
57
|
-
const returnQuestionUnanswered: ReturnQuestionProjection = {
|
|
49
|
+
const returnQuestionUnanswered: ReturnQuestionProjection<ReturnQuestionType.HOST_DEFAULT> = {
|
|
58
50
|
id: "fd7ff4a0-78ed-4c0d-aa4d-64962739c322",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
51
|
+
translationKey: "style_title",
|
|
52
|
+
type: ReturnQuestionType.HOST_DEFAULT,
|
|
53
|
+
children: [
|
|
54
|
+
{
|
|
55
|
+
id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
|
|
56
|
+
translationKey: "size_overall",
|
|
57
|
+
type: ReturnQuestionType.OPTION,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
62
60
|
};
|
|
63
61
|
|
|
64
62
|
describe("ReturnQuestionFeedbackItem component (ReturnQuestions organism)", () => {
|
|
@@ -70,7 +68,7 @@ describe("ReturnQuestionFeedbackItem component (ReturnQuestions organism)", () =
|
|
|
70
68
|
/>,
|
|
71
69
|
);
|
|
72
70
|
|
|
73
|
-
expect(getByText(returnQuestion.
|
|
71
|
+
expect(getByText(returnQuestion.translationKey)).toBeTruthy();
|
|
74
72
|
expect(getByText("size_large / size_overall")).toBeTruthy();
|
|
75
73
|
});
|
|
76
74
|
|
|
@@ -82,7 +80,7 @@ describe("ReturnQuestionFeedbackItem component (ReturnQuestions organism)", () =
|
|
|
82
80
|
/>,
|
|
83
81
|
);
|
|
84
82
|
|
|
85
|
-
expect(getByText(returnQuestionUnanswered.
|
|
83
|
+
expect(getByText(returnQuestionUnanswered.translationKey)).toBeTruthy();
|
|
86
84
|
expect(getByText(I18nMessages.FEEDBACK_UNANSWERED)).toBeTruthy();
|
|
87
85
|
});
|
|
88
86
|
});
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React, { useCallback } from "react";
|
|
2
3
|
import { View } from "react-native";
|
|
3
4
|
import { Text } from "@lookiero/aurora";
|
|
4
5
|
import { useI18nMessage, useIntl } from "@lookiero/i18n-react";
|
|
6
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
5
7
|
import { I18nMessages } from "../../../../../i18n/i18n";
|
|
6
8
|
import { useReturnQuestionFeedback } from "../../behaviors/useReturnQuestionFeedback";
|
|
7
9
|
import { feedbackForReturnQuestion } from "../../util/returnQuestionFeedback";
|
|
8
|
-
import { ReturnQuestionItem
|
|
10
|
+
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
9
11
|
import { style } from "./ReturnQuestionFeedbackItem.style";
|
|
10
12
|
|
|
11
|
-
const ReturnQuestionFeedbackItem: ReturnQuestionItem = ({ returnQuestion }
|
|
12
|
-
const titleText = useI18nMessage({ id: returnQuestion.
|
|
13
|
+
const ReturnQuestionFeedbackItem: ReturnQuestionItem<ReturnQuestionType.HOST_DEFAULT> = ({ returnQuestion }) => {
|
|
14
|
+
const titleText = useI18nMessage({ id: returnQuestion.translationKey });
|
|
13
15
|
const unansweredText = useI18nMessage({ id: I18nMessages.FEEDBACK_UNANSWERED });
|
|
14
16
|
|
|
15
17
|
const returnQuestionFeedback = useReturnQuestionFeedback();
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { fireEvent } from "@testing-library/react-native";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
ReturnQuestionType,
|
|
6
|
-
} from "../../../../../../../projection/returnQuestion/returnQuestion";
|
|
3
|
+
import { ReturnQuestionProjection } from "../../../../../../../projection/returnQuestion/returnQuestion";
|
|
4
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
7
5
|
import { render } from "../../../../../test/render";
|
|
8
6
|
import { TextareaReturnQuestionItem } from "./TextareaReturnQuestionItem";
|
|
9
7
|
|
|
@@ -15,31 +13,13 @@ jest.mock("../../behaviors/useReturnQuestionFeedback", () => ({
|
|
|
15
13
|
const returnQuestionParent = {
|
|
16
14
|
id: "0ad1dba8-b02c-4121-a1e3-981f1c30800d",
|
|
17
15
|
} as ReturnQuestionProjection;
|
|
18
|
-
const returnQuestion: ReturnQuestionProjection = {
|
|
19
|
-
id: "
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
|
|
26
|
-
name: "size_overall",
|
|
27
|
-
placeholder: "",
|
|
28
|
-
type: ReturnQuestionType.OPTION,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
id: "85e84a77-461c-41e6-8544-95b5294d0b80",
|
|
32
|
-
name: "size_trousers_too_long",
|
|
33
|
-
placeholder: "",
|
|
34
|
-
type: ReturnQuestionType.OPTION,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
id: "29441d25-8d9f-471e-a13e-a03f61c88091",
|
|
38
|
-
name: "size_fit_cut_does_not_fit",
|
|
39
|
-
placeholder: "",
|
|
40
|
-
type: ReturnQuestionType.OPTION,
|
|
41
|
-
},
|
|
42
|
-
],
|
|
16
|
+
const returnQuestion: ReturnQuestionProjection<ReturnQuestionType.TEXTAREA> = {
|
|
17
|
+
id: "1123a37d-bc00-43a4-9d28-cee1dfaf356c",
|
|
18
|
+
translationKey: "comment_textarea",
|
|
19
|
+
type: ReturnQuestionType.TEXTAREA,
|
|
20
|
+
metadata: {
|
|
21
|
+
placeholder: "comment_textarea_placeholder",
|
|
22
|
+
},
|
|
43
23
|
};
|
|
44
24
|
|
|
45
25
|
describe("TextareaReturnQuestionItem component (ReturnQuestions organism)", () => {
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React, { useCallback, useMemo } from "react";
|
|
2
3
|
import { View } from "@lookiero/aurora";
|
|
3
4
|
import { useIntl } from "@lookiero/i18n-react";
|
|
5
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
4
6
|
import { InputField } from "../../../../../../../shared/ui/components/molecules/inputField/InputField";
|
|
5
7
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../behaviors/useReturnQuestionFeedback";
|
|
6
|
-
import { ReturnQuestionItem
|
|
8
|
+
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
7
9
|
import { style } from "./TextareaReturnQuestionItem.style";
|
|
8
10
|
|
|
9
|
-
const TextareaReturnQuestionItem: ReturnQuestionItem = ({
|
|
11
|
+
const TextareaReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.TEXTAREA> = ({
|
|
10
12
|
returnQuestion,
|
|
11
13
|
returnQuestionParent,
|
|
12
14
|
testID,
|
|
13
|
-
}
|
|
15
|
+
}) => {
|
|
14
16
|
const { formatMessage } = useIntl();
|
|
15
17
|
|
|
16
18
|
const placeholderText = useMemo(
|
|
17
|
-
() => (returnQuestion.placeholder ? formatMessage({ id: returnQuestion.placeholder }) : ""),
|
|
18
|
-
[formatMessage, returnQuestion.placeholder],
|
|
19
|
+
() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""),
|
|
20
|
+
[formatMessage, returnQuestion.metadata.placeholder],
|
|
19
21
|
);
|
|
20
22
|
|
|
21
23
|
const { feedback, onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
@@ -13,14 +13,15 @@ exports[`returnQuestionFeedback utils return the deepest returnQuestion with fee
|
|
|
13
13
|
"children": [
|
|
14
14
|
{
|
|
15
15
|
"id": "1123a37d-bc00-43a4-9d28-cee1dfaf356c",
|
|
16
|
-
"
|
|
17
|
-
|
|
16
|
+
"metadata": {
|
|
17
|
+
"placeholder": "comment_textarea_placeholder",
|
|
18
|
+
},
|
|
19
|
+
"translationKey": "comment_textarea",
|
|
18
20
|
"type": "TEXTAREA",
|
|
19
21
|
},
|
|
20
22
|
],
|
|
21
23
|
"id": "ce3e8d57-5eea-4dd3-bef4-2e811a143612",
|
|
22
|
-
"
|
|
23
|
-
"placeholder": "",
|
|
24
|
+
"translationKey": "comment_title",
|
|
24
25
|
"type": "HOST_TEXTAREA",
|
|
25
26
|
},
|
|
26
27
|
false,
|