@lookiero/checkout 9.4.0 → 9.5.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/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
- package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/__snapshots__/CheckoutItemsTabs.test.tsx.snap +14 -1
- package/dist/pact.config.d.ts +0 -21
- package/dist/pact.config.js +0 -16
- 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/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +0 -55
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +0 -116
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +0 -56
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +0 -51
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +0 -51
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +0 -51
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +0 -13
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +0 -19
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +0 -56
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +0 -57
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +0 -55
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +0 -120
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +0 -55
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +0 -55
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +0 -22
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +0 -1
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +0 -7
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +0 -5
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +0 -7
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +0 -6
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +0 -4
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +0 -20
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +0 -4
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +0 -43
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +0 -12
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +0 -14
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +0 -7
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +0 -21
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +0 -8
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +0 -12
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +0 -12
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +0 -64
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +0 -10
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +0 -17
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +0 -20
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +0 -27
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +0 -10
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +0 -27
- package/dist/src/infrastructure/ui/views/App.style.d.ts +0 -6
- package/dist/src/infrastructure/ui/views/App.style.js +0 -8
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +0 -7
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +0 -11
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +0 -12
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +0 -64
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -12
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +0 -16
- package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +0 -40
- package/dist/src/infrastructure/ui/views/return/Return.style.js +0 -44
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +0 -14
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +0 -28
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +0 -7
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +0 -11
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +0 -26
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +0 -21
- package/dist/src/projection/shared/country.d.ts +0 -14
- package/dist/src/projection/shared/country.js +0 -15
- package/dist/src/projection/shared/customer.d.ts +0 -9
- package/dist/src/projection/shared/customer.js +0 -1
- package/dist/src/projection/shared/locale.d.ts +0 -12
- package/dist/src/projection/shared/locale.js +0 -13
- package/dist/src/projection/shared/order.d.ts +0 -6
- package/dist/src/projection/shared/order.js +0 -1
- package/dist/src/projection/shared/price.d.ts +0 -11
- package/dist/src/projection/shared/price.js +0 -1
- package/dist/src/projection/shared/size.d.ts +0 -21
- package/dist/src/projection/shared/size.js +0 -4
- package/dist/src/projection/shared/subscription.d.ts +0 -2
- package/dist/src/projection/shared/subscription.js +0 -1
- package/dist/src/shared/ui/components/atoms/error/Error.d.ts +0 -11
- package/dist/src/shared/ui/components/atoms/error/Error.js +0 -6
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { MatchersV3, PactV3 } from "@pact-foundation/pact";
|
|
2
|
-
import { fetchHttpPost } from "@lookiero/sty-psp-http";
|
|
3
|
-
import {
|
|
4
|
-
AUTH_TOKEN,
|
|
5
|
-
DEFAULT_PACT_OPTIONS,
|
|
6
|
-
DEFAULT_REQUEST_HEADERS,
|
|
7
|
-
DEFAULT_RESPONSE_HEADERS,
|
|
8
|
-
fromMockServerUrlToApiUrl,
|
|
9
|
-
} from "../../../../pact.config";
|
|
10
|
-
import { checkoutQuestions } from "./checkoutQuestions.mock";
|
|
11
|
-
import { httpCheckoutQuestionsByCheckoutIdView } from "./httpCheckoutQuestionsByCheckoutIdView";
|
|
12
|
-
|
|
13
|
-
const provider = new PactV3({
|
|
14
|
-
...DEFAULT_PACT_OPTIONS,
|
|
15
|
-
consumer: "STY-BOX_CHECKOUT-FRONT",
|
|
16
|
-
provider: "STY-BOX_CHECKOUT-BACK_ListCheckoutQuestionsByCheckoutId",
|
|
17
|
-
});
|
|
18
|
-
const checkoutId = "52440ae5-7a4c-498b-8b35-08ecfde15776";
|
|
19
|
-
const checkoutQuestionsResponse = {
|
|
20
|
-
result: checkoutQuestions,
|
|
21
|
-
};
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
23
|
-
// @ts-ignore
|
|
24
|
-
const EXPECTED_BODY = MatchersV3.like(checkoutQuestionsResponse);
|
|
25
|
-
describe("STY-BOX_CHECKOUT-BACK_ListCheckoutQuestionsByCheckoutId API", () => {
|
|
26
|
-
it("returns a valid checkout questions for the given checkout id", () => {
|
|
27
|
-
provider
|
|
28
|
-
.given("a valid checkout questions for the given checkout id")
|
|
29
|
-
.uponReceiving("checkout questions projection")
|
|
30
|
-
.withRequest({
|
|
31
|
-
method: "POST",
|
|
32
|
-
path: "/api/list-checkout-questions-by-checkout-id",
|
|
33
|
-
headers: DEFAULT_REQUEST_HEADERS,
|
|
34
|
-
body: { checkoutId },
|
|
35
|
-
})
|
|
36
|
-
.willRespondWith({
|
|
37
|
-
status: 200,
|
|
38
|
-
headers: DEFAULT_RESPONSE_HEADERS,
|
|
39
|
-
body: EXPECTED_BODY,
|
|
40
|
-
});
|
|
41
|
-
return provider.executeTest(async (mockserver) => {
|
|
42
|
-
const httpPost = fetchHttpPost({
|
|
43
|
-
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
44
|
-
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
45
|
-
device: "web",
|
|
46
|
-
version: "1.0.0",
|
|
47
|
-
});
|
|
48
|
-
const response = await httpCheckoutQuestionsByCheckoutIdView({ httpPost })({
|
|
49
|
-
checkoutId,
|
|
50
|
-
signal: undefined,
|
|
51
|
-
});
|
|
52
|
-
expect(response).toStrictEqual(checkoutQuestionsResponse.result);
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
});
|
package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { MatchersV3, PactV3 } from "@pact-foundation/pact";
|
|
2
|
-
import { fetchHttpPost } from "@lookiero/sty-psp-http";
|
|
3
|
-
import {
|
|
4
|
-
AUTH_TOKEN,
|
|
5
|
-
DEFAULT_PACT_OPTIONS,
|
|
6
|
-
DEFAULT_REQUEST_HEADERS,
|
|
7
|
-
DEFAULT_RESPONSE_HEADERS,
|
|
8
|
-
fromMockServerUrlToApiUrl,
|
|
9
|
-
} from "../../../../pact.config";
|
|
10
|
-
import { httpPaymentFlowPayloadByCheckoutIdView } from "./httpPaymentFlowPayloadByCheckoutIdView";
|
|
11
|
-
import {
|
|
12
|
-
paymentFlowPayloadForKeptItems,
|
|
13
|
-
paymentFlowPayloadForReturnedItems,
|
|
14
|
-
paymentFlowPayloadForReplacedItems,
|
|
15
|
-
} from "./paymentFlowPayload.mock";
|
|
16
|
-
|
|
17
|
-
const provider = new PactV3({
|
|
18
|
-
...DEFAULT_PACT_OPTIONS,
|
|
19
|
-
consumer: "STY-BOX_CHECKOUT-FRONT",
|
|
20
|
-
provider: "STY-BOX_CHECKOUT-BACK_ViewPaymentFlowPayloadByCheckoutId",
|
|
21
|
-
});
|
|
22
|
-
const checkoutId = "e2490de5-5bd3-43d5-b7c4-526e33f71304";
|
|
23
|
-
const paymentFlowPayloadForKeptItemsResponse = {
|
|
24
|
-
result: paymentFlowPayloadForKeptItems,
|
|
25
|
-
};
|
|
26
|
-
const paymentFlowPayloadForReturnedItemsResponse = {
|
|
27
|
-
result: paymentFlowPayloadForReturnedItems,
|
|
28
|
-
};
|
|
29
|
-
const paymentFlowPayloadForReplacedItemsResponse = {
|
|
30
|
-
result: paymentFlowPayloadForReplacedItems,
|
|
31
|
-
};
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
33
|
-
// @ts-ignore
|
|
34
|
-
const EXPECTED_BODY_FOR_KEPT_ITEMS = MatchersV3.like(paymentFlowPayloadForKeptItemsResponse);
|
|
35
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
36
|
-
// @ts-ignore
|
|
37
|
-
const EXPECTED_BODY_FOR_RETURNED_ITEMS = MatchersV3.like(paymentFlowPayloadForReturnedItemsResponse);
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
39
|
-
// @ts-ignore
|
|
40
|
-
const EXPECTED_BODY_FOR_REPLACED_ITEMS = MatchersV3.like(paymentFlowPayloadForReplacedItemsResponse);
|
|
41
|
-
describe("STY-BOX_CHECKOUT-BACK_ViewPaymentFlowPayloadByCheckoutId API", () => {
|
|
42
|
-
it("returns a valid payment-flow payload for the given checkout id [KEPT items] ", () => {
|
|
43
|
-
provider
|
|
44
|
-
.given("a valid payment-flow payload for the given checkout id [KEPT items] ")
|
|
45
|
-
.uponReceiving("payment-flow payload projection")
|
|
46
|
-
.withRequest({
|
|
47
|
-
method: "POST",
|
|
48
|
-
path: "/api/view-payment-flow-payload-by-checkout-id",
|
|
49
|
-
headers: DEFAULT_REQUEST_HEADERS,
|
|
50
|
-
body: { checkoutId },
|
|
51
|
-
})
|
|
52
|
-
.willRespondWith({
|
|
53
|
-
status: 200,
|
|
54
|
-
headers: DEFAULT_RESPONSE_HEADERS,
|
|
55
|
-
body: EXPECTED_BODY_FOR_KEPT_ITEMS,
|
|
56
|
-
});
|
|
57
|
-
return provider.executeTest(async (mockserver) => {
|
|
58
|
-
const httpPost = fetchHttpPost({
|
|
59
|
-
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
60
|
-
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
61
|
-
device: "web",
|
|
62
|
-
version: "1.0.0",
|
|
63
|
-
});
|
|
64
|
-
const response = await httpPaymentFlowPayloadByCheckoutIdView({ httpPost })({ checkoutId, signal: undefined });
|
|
65
|
-
expect(response).toStrictEqual(paymentFlowPayloadForKeptItemsResponse.result);
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
it("returns a valid payment-flow payload for the given checkout id [RETURNED items] ", () => {
|
|
69
|
-
provider
|
|
70
|
-
.given("a valid payment-flow payload for the given checkout id [RETURNED items] ")
|
|
71
|
-
.uponReceiving("payment-flow payload projection")
|
|
72
|
-
.withRequest({
|
|
73
|
-
method: "POST",
|
|
74
|
-
path: "/api/view-payment-flow-payload-by-checkout-id",
|
|
75
|
-
headers: DEFAULT_REQUEST_HEADERS,
|
|
76
|
-
body: { checkoutId },
|
|
77
|
-
})
|
|
78
|
-
.willRespondWith({
|
|
79
|
-
status: 200,
|
|
80
|
-
headers: DEFAULT_RESPONSE_HEADERS,
|
|
81
|
-
body: EXPECTED_BODY_FOR_RETURNED_ITEMS,
|
|
82
|
-
});
|
|
83
|
-
return provider.executeTest(async (mockserver) => {
|
|
84
|
-
const httpPost = fetchHttpPost({
|
|
85
|
-
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
86
|
-
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
87
|
-
device: "web",
|
|
88
|
-
version: "1.0.0",
|
|
89
|
-
});
|
|
90
|
-
const response = await httpPaymentFlowPayloadByCheckoutIdView({ httpPost })({ checkoutId, signal: undefined });
|
|
91
|
-
expect(response).toStrictEqual(paymentFlowPayloadForReturnedItemsResponse.result);
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
it("returns a valid payment-flow payload for the given checkout id [REPLACED items] ", () => {
|
|
95
|
-
provider
|
|
96
|
-
.given("a valid payment-flow payload for the given checkout id [REPLACED items] ")
|
|
97
|
-
.uponReceiving("payment-flow payload projection")
|
|
98
|
-
.withRequest({
|
|
99
|
-
method: "POST",
|
|
100
|
-
path: "/api/view-payment-flow-payload-by-checkout-id",
|
|
101
|
-
headers: DEFAULT_REQUEST_HEADERS,
|
|
102
|
-
body: { checkoutId },
|
|
103
|
-
})
|
|
104
|
-
.willRespondWith({
|
|
105
|
-
status: 200,
|
|
106
|
-
headers: DEFAULT_RESPONSE_HEADERS,
|
|
107
|
-
body: EXPECTED_BODY_FOR_REPLACED_ITEMS,
|
|
108
|
-
});
|
|
109
|
-
return provider.executeTest(async (mockserver) => {
|
|
110
|
-
const httpPost = fetchHttpPost({
|
|
111
|
-
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
112
|
-
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
113
|
-
device: "web",
|
|
114
|
-
version: "1.0.0",
|
|
115
|
-
});
|
|
116
|
-
const response = await httpPaymentFlowPayloadByCheckoutIdView({ httpPost })({ checkoutId, signal: undefined });
|
|
117
|
-
expect(response).toStrictEqual(paymentFlowPayloadForReplacedItemsResponse.result);
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { MatchersV3, PactV3 } from "@pact-foundation/pact";
|
|
2
|
-
import { fetchHttpPost } from "@lookiero/sty-psp-http";
|
|
3
|
-
import {
|
|
4
|
-
AUTH_TOKEN,
|
|
5
|
-
DEFAULT_PACT_OPTIONS,
|
|
6
|
-
DEFAULT_REQUEST_HEADERS,
|
|
7
|
-
DEFAULT_RESPONSE_HEADERS,
|
|
8
|
-
fromMockServerUrlToApiUrl,
|
|
9
|
-
} from "../../../../pact.config";
|
|
10
|
-
import { httpPricingByCheckoutIdView } from "./httpPricingByCheckoutIdView";
|
|
11
|
-
import { pricing } from "./pricing.mock";
|
|
12
|
-
|
|
13
|
-
const provider = new PactV3({
|
|
14
|
-
...DEFAULT_PACT_OPTIONS,
|
|
15
|
-
consumer: "STY-BOX_CHECKOUT-FRONT",
|
|
16
|
-
provider: "STY-BOX_CHECKOUT-BACK_ViewPricingByCheckoutId",
|
|
17
|
-
});
|
|
18
|
-
const checkoutId = "6f720954-8039-4bed-9596-34fc5a02131b";
|
|
19
|
-
const pricingResponse = {
|
|
20
|
-
result: pricing(),
|
|
21
|
-
};
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
23
|
-
// @ts-ignore
|
|
24
|
-
const EXPECTED_BODY = MatchersV3.like(pricingResponse);
|
|
25
|
-
describe("STY-BOX_CHECKOUT-BACK_ViewPricingByCheckoutId API", () => {
|
|
26
|
-
it("returns a valid pricing for the given checkout", () => {
|
|
27
|
-
provider
|
|
28
|
-
.given("a valid pricing for the given checkout")
|
|
29
|
-
.uponReceiving("pricing projection")
|
|
30
|
-
.withRequest({
|
|
31
|
-
method: "POST",
|
|
32
|
-
path: "/api/view-pricing-by-checkout-id",
|
|
33
|
-
headers: DEFAULT_REQUEST_HEADERS,
|
|
34
|
-
body: { checkoutId },
|
|
35
|
-
})
|
|
36
|
-
.willRespondWith({
|
|
37
|
-
status: 200,
|
|
38
|
-
headers: DEFAULT_RESPONSE_HEADERS,
|
|
39
|
-
body: EXPECTED_BODY,
|
|
40
|
-
});
|
|
41
|
-
return provider.executeTest(async (mockserver) => {
|
|
42
|
-
const httpPost = fetchHttpPost({
|
|
43
|
-
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
44
|
-
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
45
|
-
device: "web",
|
|
46
|
-
version: "1.0.0",
|
|
47
|
-
});
|
|
48
|
-
const response = await httpPricingByCheckoutIdView({ httpPost })({
|
|
49
|
-
checkoutId,
|
|
50
|
-
signal: undefined,
|
|
51
|
-
});
|
|
52
|
-
expect(response).toStrictEqual(pricingResponse.result);
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { MatchersV3, PactV3 } from "@pact-foundation/pact";
|
|
2
|
-
import { fetchHttpPost } from "@lookiero/sty-psp-http";
|
|
3
|
-
import {
|
|
4
|
-
AUTH_TOKEN,
|
|
5
|
-
DEFAULT_PACT_OPTIONS,
|
|
6
|
-
DEFAULT_REQUEST_HEADERS,
|
|
7
|
-
DEFAULT_RESPONSE_HEADERS,
|
|
8
|
-
fromMockServerUrlToApiUrl,
|
|
9
|
-
} from "../../../../pact.config";
|
|
10
|
-
import { httpReturnQuestionsByCheckoutItemIdView } from "./httpReturnQuestionsByCheckoutItemIdView";
|
|
11
|
-
import { returnQuestions } from "./returnQuestions.mock";
|
|
12
|
-
|
|
13
|
-
const provider = new PactV3({
|
|
14
|
-
...DEFAULT_PACT_OPTIONS,
|
|
15
|
-
consumer: "STY-BOX_CHECKOUT-FRONT",
|
|
16
|
-
provider: "STY-BOX_CHECKOUT-BACK_ListReturnQuestionsByCheckoutItemId",
|
|
17
|
-
});
|
|
18
|
-
const checkoutItemId = "52440ae5-7a4c-498b-8b35-08ecfde15776";
|
|
19
|
-
const returnQuestionsResponse = {
|
|
20
|
-
result: returnQuestions,
|
|
21
|
-
};
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
23
|
-
// @ts-ignore
|
|
24
|
-
const EXPECTED_BODY = MatchersV3.like(returnQuestionsResponse);
|
|
25
|
-
describe("STY-BOX_CHECKOUT-BACK_ListReturnQuestionsByCheckoutItemId API", () => {
|
|
26
|
-
it("returns a valid return questions for the given checkout item id", () => {
|
|
27
|
-
provider
|
|
28
|
-
.given("a valid return questions for the given checkout item id")
|
|
29
|
-
.uponReceiving("return questions projection")
|
|
30
|
-
.withRequest({
|
|
31
|
-
method: "POST",
|
|
32
|
-
path: "/api/list-return-questions-by-checkout-item-id",
|
|
33
|
-
headers: DEFAULT_REQUEST_HEADERS,
|
|
34
|
-
body: { checkoutItemId },
|
|
35
|
-
})
|
|
36
|
-
.willRespondWith({
|
|
37
|
-
status: 200,
|
|
38
|
-
headers: DEFAULT_RESPONSE_HEADERS,
|
|
39
|
-
body: EXPECTED_BODY,
|
|
40
|
-
});
|
|
41
|
-
return provider.executeTest(async (mockserver) => {
|
|
42
|
-
const httpPost = fetchHttpPost({
|
|
43
|
-
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
44
|
-
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
45
|
-
device: "web",
|
|
46
|
-
version: "1.0.0",
|
|
47
|
-
});
|
|
48
|
-
const response = await httpReturnQuestionsByCheckoutItemIdView({ httpPost })({
|
|
49
|
-
checkoutItemId,
|
|
50
|
-
signal: undefined,
|
|
51
|
-
});
|
|
52
|
-
expect(response).toStrictEqual(returnQuestionsResponse.result);
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { FC, ReactNode, RefObject } from "react";
|
|
2
|
-
import { LayoutChangeEvent, ScrollView, StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
|
|
4
|
-
interface LayoutStyle {
|
|
5
|
-
readonly safeAreaView: StyleProp<ViewStyle>;
|
|
6
|
-
readonly scrollView: StyleProp<ViewStyle>;
|
|
7
|
-
readonly header: StyleProp<ViewStyle>;
|
|
8
|
-
}
|
|
9
|
-
interface LayoutProps {
|
|
10
|
-
readonly children: ReactNode;
|
|
11
|
-
readonly header?: JSX.Element | null;
|
|
12
|
-
readonly footer?: JSX.Element | null;
|
|
13
|
-
readonly panel?: JSX.Element | null;
|
|
14
|
-
readonly stickyHeader?: boolean;
|
|
15
|
-
readonly stickyHeaderHiddenOnScroll?: boolean;
|
|
16
|
-
readonly scrollRef?: RefObject<ScrollView>;
|
|
17
|
-
readonly scrollEnabled?: boolean;
|
|
18
|
-
readonly style?: Partial<LayoutStyle>;
|
|
19
|
-
readonly onLayout?: (event: LayoutChangeEvent) => void;
|
|
20
|
-
}
|
|
21
|
-
type Layout = FC<LayoutProps>;
|
|
22
|
-
export type { Layout };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Platform, StyleSheet } from "react-native";
|
|
2
|
-
import { HEADER_HEIGHT } from "../../../../templates/header/Header.style";
|
|
3
|
-
|
|
4
|
-
const style = StyleSheet.create({
|
|
5
|
-
header: {
|
|
6
|
-
...Platform.select({
|
|
7
|
-
web: {
|
|
8
|
-
position: "sticky",
|
|
9
|
-
top: 0,
|
|
10
|
-
zIndex: 10,
|
|
11
|
-
height: HEADER_HEIGHT,
|
|
12
|
-
},
|
|
13
|
-
native: {
|
|
14
|
-
position: "relative",
|
|
15
|
-
height: HEADER_HEIGHT,
|
|
16
|
-
},
|
|
17
|
-
}),
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
export { style };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react/prop-types */
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { View } from "react-native";
|
|
4
|
-
import { GestureHandlerRootView, ScrollView as RNGHScrollView } from "react-native-gesture-handler";
|
|
5
|
-
import { SafeAreaView } from "react-native-safe-area-context";
|
|
6
|
-
import { Footer as DefaultFooter } from "../../../templates/footer/Footer";
|
|
7
|
-
import { DefaultHeader } from "../../../templates/header/defaultHeader/DefaultHeader";
|
|
8
|
-
import { Footer } from "../components/footer/Footer";
|
|
9
|
-
import { Header } from "../components/header/Header";
|
|
10
|
-
import { style } from "./DummyLayout.style";
|
|
11
|
-
|
|
12
|
-
const DummyLayout = ({
|
|
13
|
-
children,
|
|
14
|
-
header = React.createElement(DefaultHeader, null),
|
|
15
|
-
footer = React.createElement(DefaultFooter, null),
|
|
16
|
-
panel,
|
|
17
|
-
style: customStyle,
|
|
18
|
-
scrollEnabled,
|
|
19
|
-
onLayout,
|
|
20
|
-
}) =>
|
|
21
|
-
React.createElement(
|
|
22
|
-
SafeAreaView,
|
|
23
|
-
{ style: [style.safeAreaView, customStyle?.safeAreaView] },
|
|
24
|
-
React.createElement(
|
|
25
|
-
GestureHandlerRootView,
|
|
26
|
-
{ style: { flex: 1 } },
|
|
27
|
-
React.createElement(
|
|
28
|
-
RNGHScrollView,
|
|
29
|
-
{
|
|
30
|
-
contentContainerStyle: [style.scrollView, customStyle?.scrollView],
|
|
31
|
-
scrollEnabled: scrollEnabled,
|
|
32
|
-
scrollEventThrottle: 16,
|
|
33
|
-
showsVerticalScrollIndicator: false,
|
|
34
|
-
stickyHeaderIndices: [0],
|
|
35
|
-
},
|
|
36
|
-
React.createElement(Header, null, header),
|
|
37
|
-
panel,
|
|
38
|
-
React.createElement(View, { style: style.children, onLayout: onLayout }, children),
|
|
39
|
-
),
|
|
40
|
-
),
|
|
41
|
-
React.createElement(Footer, null, footer),
|
|
42
|
-
);
|
|
43
|
-
export { DummyLayout };
|
package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ButtonIcon } from "@lookiero/aurora";
|
|
3
|
-
import { Header } from "../Header";
|
|
4
|
-
import { ButtonIconPlaceholder } from "../buttonIconPlaceholder/ButtonIconPlaceholder";
|
|
5
|
-
import { Logo } from "../logo/Logo";
|
|
6
|
-
import { style } from "./DefaultHeader.style";
|
|
7
|
-
|
|
8
|
-
const DefaultHeader = ({ onPressMenu }) =>
|
|
9
|
-
React.createElement(
|
|
10
|
-
Header,
|
|
11
|
-
{ testID: "default-header" },
|
|
12
|
-
React.createElement(Logo, null),
|
|
13
|
-
React.createElement(ButtonIconPlaceholder, null),
|
|
14
|
-
React.createElement(ButtonIcon, {
|
|
15
|
-
name: "menu",
|
|
16
|
-
style: style.button,
|
|
17
|
-
testID: "menu-button-icon",
|
|
18
|
-
onPress: onPressMenu,
|
|
19
|
-
}),
|
|
20
|
-
);
|
|
21
|
-
export { DefaultHeader };
|
package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { StyleSheet } from "react-native";
|
|
2
|
-
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
|
-
|
|
4
|
-
const { space10 } = theme();
|
|
5
|
-
const style = StyleSheet.create({
|
|
6
|
-
button: {
|
|
7
|
-
alignSelf: "auto",
|
|
8
|
-
height: space10,
|
|
9
|
-
width: space10,
|
|
10
|
-
},
|
|
11
|
-
});
|
|
12
|
-
export { style };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { FC, ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
declare enum NewFeedbackExperimentVariation {
|
|
4
|
-
CONTROL = "control",
|
|
5
|
-
RETURN_PAGE = "return_page",
|
|
6
|
-
}
|
|
7
|
-
interface NewFeedbackExperimentProviderProps {
|
|
8
|
-
readonly children: ReactNode;
|
|
9
|
-
}
|
|
10
|
-
declare const NewFeedbackExperimentProvider: FC<NewFeedbackExperimentProviderProps>;
|
|
11
|
-
declare const useNewFeedbackExperiment: () => NewFeedbackExperimentVariation;
|
|
12
|
-
export { useNewFeedbackExperiment, NewFeedbackExperimentProvider, NewFeedbackExperimentVariation };
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import React, { createContext, useContext, useEffect, useMemo, useRef } from "react";
|
|
2
|
-
import invariant from "tiny-invariant";
|
|
3
|
-
import { Spinner } from "@lookiero/aurora";
|
|
4
|
-
import { useAssignedVariationByExperimentId } from "@lookiero/sty-psp-ab-testing";
|
|
5
|
-
import { useViewFirstAvailableCheckoutByCustomerId } from "../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
6
|
-
import { useTrackAssignedVariationByExperiment } from "../../tracking/useTrackAssignedVariationByExperiment";
|
|
7
|
-
import { useStaticInfo } from "./useStaticInfo";
|
|
8
|
-
|
|
9
|
-
var NewFeedbackExperimentVariation;
|
|
10
|
-
(function (NewFeedbackExperimentVariation) {
|
|
11
|
-
NewFeedbackExperimentVariation["CONTROL"] = "control";
|
|
12
|
-
NewFeedbackExperimentVariation["RETURN_PAGE"] = "return_page";
|
|
13
|
-
})(NewFeedbackExperimentVariation || (NewFeedbackExperimentVariation = {}));
|
|
14
|
-
const NewFeedbackExperimentContext = createContext(null);
|
|
15
|
-
const NewFeedbackExperimentProvider = ({ children }) => {
|
|
16
|
-
const {
|
|
17
|
-
kameleoon: {
|
|
18
|
-
experiments: {
|
|
19
|
-
newFeedback: { id: newFeedbackId, variations },
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
customer: { customerId, country, segment },
|
|
23
|
-
} = useStaticInfo();
|
|
24
|
-
const [checkout] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
25
|
-
const { assignedVariation: newFeedbackVariation } = useAssignedVariationByExperimentId({
|
|
26
|
-
experimentId: newFeedbackId,
|
|
27
|
-
});
|
|
28
|
-
const trackAssignedVariation = useTrackAssignedVariationByExperiment({
|
|
29
|
-
checkoutId: checkout?.id,
|
|
30
|
-
country,
|
|
31
|
-
segment,
|
|
32
|
-
experimentId: newFeedbackId,
|
|
33
|
-
});
|
|
34
|
-
const value = useMemo(
|
|
35
|
-
() => ({
|
|
36
|
-
variation:
|
|
37
|
-
newFeedbackVariation?.id === Number(variations.v1)
|
|
38
|
-
? NewFeedbackExperimentVariation.RETURN_PAGE
|
|
39
|
-
: NewFeedbackExperimentVariation.CONTROL,
|
|
40
|
-
}),
|
|
41
|
-
[newFeedbackVariation?.id, variations.v1],
|
|
42
|
-
);
|
|
43
|
-
const assignedVariantTracked = useRef(false);
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
if (assignedVariantTracked.current || !newFeedbackVariation || !checkout?.id) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
trackAssignedVariation({ assignedVariation: newFeedbackVariation });
|
|
49
|
-
assignedVariantTracked.current = true;
|
|
50
|
-
}, [checkout?.id, newFeedbackVariation, trackAssignedVariation]);
|
|
51
|
-
if (!checkout) {
|
|
52
|
-
return React.createElement(Spinner, null);
|
|
53
|
-
}
|
|
54
|
-
return React.createElement(NewFeedbackExperimentContext.Provider, { value: value }, children);
|
|
55
|
-
};
|
|
56
|
-
const useNewFeedbackExperiment = () => {
|
|
57
|
-
const newFeedbackExperiment = useContext(NewFeedbackExperimentContext);
|
|
58
|
-
invariant(
|
|
59
|
-
newFeedbackExperiment,
|
|
60
|
-
"Your are trying to use the useNewFeedbackExperiment hook without wrapping your app with the <NewFeedbackExperimentProvider>.",
|
|
61
|
-
);
|
|
62
|
-
return newFeedbackExperiment.variation;
|
|
63
|
-
};
|
|
64
|
-
export { useNewFeedbackExperiment, NewFeedbackExperimentProvider, NewFeedbackExperimentVariation };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { EndpointFunction, FetchTranslationFuction } from "@lookiero/i18n";
|
|
2
|
-
|
|
3
|
-
interface FetchTranslationsFuntionArgs {
|
|
4
|
-
readonly translations: EndpointFunction[];
|
|
5
|
-
}
|
|
6
|
-
interface FetchTranslationsFuntion {
|
|
7
|
-
(args: FetchTranslationsFuntionArgs): FetchTranslationFuction;
|
|
8
|
-
}
|
|
9
|
-
declare const fetchTranslations: FetchTranslationsFuntion;
|
|
10
|
-
export { fetchTranslations };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { fetchFetchTranslation } from "@lookiero/i18n";
|
|
2
|
-
|
|
3
|
-
const fetchTranslations =
|
|
4
|
-
({ translations }) =>
|
|
5
|
-
async ({ locale }) => {
|
|
6
|
-
const translationsMessages = await Promise.all(
|
|
7
|
-
translations.map((endpoint) => fetchFetchTranslation({ endpoint })({ locale })),
|
|
8
|
-
);
|
|
9
|
-
return translationsMessages.reduce(
|
|
10
|
-
(acc, translationMessages) => ({
|
|
11
|
-
...acc,
|
|
12
|
-
...translationMessages,
|
|
13
|
-
}),
|
|
14
|
-
{},
|
|
15
|
-
);
|
|
16
|
-
};
|
|
17
|
-
export { fetchTranslations };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { EndpointFunction } from "@lookiero/i18n";
|
|
2
|
-
|
|
3
|
-
interface TranslationEndpointFunctionArgs {
|
|
4
|
-
readonly translationsUrl: string;
|
|
5
|
-
readonly translationsApiKey: string;
|
|
6
|
-
}
|
|
7
|
-
interface TranslationEndpointFunction {
|
|
8
|
-
(args: TranslationEndpointFunctionArgs): EndpointFunction;
|
|
9
|
-
}
|
|
10
|
-
declare const translationEndpoint: TranslationEndpointFunction;
|
|
11
|
-
type Project = "user-area-front" | "inventory-catalog" | "checkout";
|
|
12
|
-
interface TranslationExternalEndpointFunctionArgs {
|
|
13
|
-
readonly translationsUrl: string;
|
|
14
|
-
readonly projects: [project: Project, filter?: string][];
|
|
15
|
-
}
|
|
16
|
-
interface TranslationExternalEndpointFunction {
|
|
17
|
-
(args: TranslationExternalEndpointFunctionArgs): EndpointFunction;
|
|
18
|
-
}
|
|
19
|
-
declare const translationExternalEndpoint: TranslationExternalEndpointFunction;
|
|
20
|
-
export { translationEndpoint, translationExternalEndpoint };
|