@lookiero/checkout 11.5.0 → 12.1.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/index.d.ts +1 -2
- package/dist/src/ExpoRoot.d.ts +0 -1
- package/dist/src/ExpoRoot.js +2 -3
- package/dist/src/infrastructure/tracking/useTrackAssignedVariationByExperiment.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackAssignedVariationByExperiment.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackChangeFeedback.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackChangeFeedback.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackCheckout.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackCheckout.js +3 -1
- package/dist/src/infrastructure/tracking/useTrackImageView.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackImageView.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackItemPageView.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackItemPageView.js +3 -1
- package/dist/src/infrastructure/tracking/useTrackKeepItem.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackKeepItem.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackPageView.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackPageView.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackPressBack.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackPressBack.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackPressContinue.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackPressContinue.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackPressItem.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackPressItem.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackPressNext.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackPressNext.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackPressPrevious.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackPressPrevious.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackPressPricing.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackPressPricing.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackReplaceItem.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackReplaceItem.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackResetItem.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackResetItem.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackReturnItem.d.ts +2 -0
- package/dist/src/infrastructure/tracking/useTrackReturnItem.js +3 -2
- package/dist/src/infrastructure/tracking/useTrackTabView.d.ts +3 -1
- package/dist/src/infrastructure/tracking/useTrackTabView.js +3 -2
- package/dist/src/infrastructure/ui/hooks/useCheckoutFlow.js +2 -1
- package/dist/src/infrastructure/ui/routing/CheckoutMiddleware.d.ts +1 -1
- package/dist/src/infrastructure/ui/routing/CheckoutMiddleware.js +5 -3
- package/dist/src/infrastructure/ui/test/render.js +1 -1
- package/dist/src/infrastructure/ui/views/App.d.ts +1 -1
- package/dist/src/infrastructure/ui/views/checkout/Checkout.js +4 -1
- package/dist/src/infrastructure/ui/views/feedback/Feedback.js +4 -1
- package/dist/src/infrastructure/ui/views/item/Item.js +5 -1
- package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.js +3 -2
- package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.js +4 -2
- package/dist/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.d.ts +2 -0
- package/dist/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.js +2 -1
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +5 -2
- package/dist/src/infrastructure/ui/views/summary/Summary.js +4 -1
- package/dist/src/infrastructure/ui/views/summaryTabs/SummaryTabs.js +4 -1
- package/dist/src/projection/returnQuestion/returnQuestion.typeguard.d.ts +2 -2
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/index.ts +1 -1
- package/jest.config.js +0 -3
- package/jest.setup.js +9 -1
- package/package.json +22 -20
- package/src/ExpoRoot.tsx +2 -3
- package/src/infrastructure/tracking/useTrackAssignedVariationByExperiment.test.ts +4 -0
- package/src/infrastructure/tracking/useTrackAssignedVariationByExperiment.ts +5 -1
- package/src/infrastructure/tracking/useTrackChangeFeedback.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackChangeFeedback.ts +5 -2
- package/src/infrastructure/tracking/useTrackCheckout.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackCheckout.ts +5 -0
- package/src/infrastructure/tracking/useTrackImageView.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackImageView.ts +5 -1
- package/src/infrastructure/tracking/useTrackItemPageView.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackItemPageView.ts +5 -0
- package/src/infrastructure/tracking/useTrackKeepItem.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackKeepItem.ts +12 -2
- package/src/infrastructure/tracking/useTrackPageView.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackPageView.ts +5 -2
- package/src/infrastructure/tracking/useTrackPressBack.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackPressBack.ts +5 -2
- package/src/infrastructure/tracking/useTrackPressContinue.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackPressContinue.ts +5 -2
- package/src/infrastructure/tracking/useTrackPressItem.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackPressItem.ts +5 -2
- package/src/infrastructure/tracking/useTrackPressNext.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackPressNext.ts +5 -2
- package/src/infrastructure/tracking/useTrackPressPrevious.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackPressPrevious.ts +5 -2
- package/src/infrastructure/tracking/useTrackPressPricing.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackPressPricing.ts +5 -2
- package/src/infrastructure/tracking/useTrackReplaceItem.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackReplaceItem.ts +5 -1
- package/src/infrastructure/tracking/useTrackResetItem.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackResetItem.ts +12 -2
- package/src/infrastructure/tracking/useTrackReturnItem.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackReturnItem.ts +12 -2
- package/src/infrastructure/tracking/useTrackTabView.test.tsx +4 -0
- package/src/infrastructure/tracking/useTrackTabView.ts +5 -1
- package/src/infrastructure/ui/hooks/useCheckoutFlow.test.tsx +11 -1
- package/src/infrastructure/ui/hooks/useCheckoutFlow.tsx +2 -0
- package/src/infrastructure/ui/hooks/useQueryBus.test.tsx +1 -1
- package/src/infrastructure/ui/hooks/useStaticInfo.test.tsx +1 -1
- package/src/infrastructure/ui/routing/CheckoutMiddleware.tsx +6 -4
- package/src/infrastructure/ui/test/render.tsx +1 -1
- package/src/infrastructure/ui/views/App.tsx +1 -1
- package/src/infrastructure/ui/views/checkout/Checkout.test.tsx +9 -2
- package/src/infrastructure/ui/views/checkout/Checkout.tsx +4 -0
- package/src/infrastructure/ui/views/feedback/Feedback.test.tsx +7 -1
- package/src/infrastructure/ui/views/feedback/Feedback.tsx +4 -0
- package/src/infrastructure/ui/views/item/Item.test.tsx +7 -1
- package/src/infrastructure/ui/views/item/Item.tsx +5 -0
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +34 -43
- package/src/infrastructure/ui/views/item/components/itemActions/__snapshots__/ItemActions.test.tsx.snap +34 -43
- package/src/infrastructure/ui/views/item/components/productVariantSlider/__snapshots__/ProductVariantSlider.test.tsx.snap +76 -99
- package/src/infrastructure/ui/views/item/components/selectModal/__snapshots__/SelecModal.test.tsx.snap +34 -43
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +34 -43
- package/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.test.tsx +7 -1
- package/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.tsx +3 -0
- package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.test.tsx +7 -1
- package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.tsx +4 -0
- package/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.test.tsx +2 -0
- package/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.tsx +4 -0
- package/src/infrastructure/ui/views/item/views/productVariant/__snapshots__/ProductVariant.test.tsx.snap +228 -297
- package/src/infrastructure/ui/views/return/Return.test.tsx +8 -1
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.test.tsx +2 -1
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +5 -2
- package/src/infrastructure/ui/views/shared/components/productVariant/__snapshots__/ProductVariant.test.tsx.snap +26 -32
- package/src/infrastructure/ui/views/summary/Summary.test.tsx +7 -1
- package/src/infrastructure/ui/views/summary/Summary.tsx +4 -0
- package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/CollapsiblePricing.test.tsx.snap +16 -24
- package/src/infrastructure/ui/views/summaryTabs/SummaryTabs.test.tsx +7 -1
- package/src/infrastructure/ui/views/summaryTabs/SummaryTabs.tsx +4 -0
- package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/__snapshots__/CheckoutItemsTabs.test.tsx.snap +105 -135
|
@@ -3,6 +3,7 @@ import { Variation } from "@lookiero/sty-psp-ab-testing";
|
|
|
3
3
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
4
4
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
5
5
|
import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
6
|
+
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
6
7
|
import { ABTestTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
7
8
|
import { PROJECT } from "./tracking";
|
|
8
9
|
import { useTrackAssignedVariationByExperiment as sut } from "./useTrackAssignedVariationByExperiment";
|
|
@@ -18,6 +19,7 @@ const assignedVariation: Variation = {
|
|
|
18
19
|
id: 964072,
|
|
19
20
|
name: "Variation 1",
|
|
20
21
|
};
|
|
22
|
+
const tradename = Tradename.LOOKIERO;
|
|
21
23
|
|
|
22
24
|
const event: ABTestTrackingEvent = {
|
|
23
25
|
event: TrackingEventName.AB_TEST,
|
|
@@ -26,6 +28,7 @@ const event: ABTestTrackingEvent = {
|
|
|
26
28
|
store: country,
|
|
27
29
|
checkoutId,
|
|
28
30
|
segment,
|
|
31
|
+
tradename,
|
|
29
32
|
experiment: experimentId,
|
|
30
33
|
variation: String(assignedVariation.id),
|
|
31
34
|
};
|
|
@@ -40,6 +43,7 @@ describe("useTrackAssignedVariationByExperiment custom hook", () => {
|
|
|
40
43
|
country,
|
|
41
44
|
checkoutId,
|
|
42
45
|
segment,
|
|
46
|
+
tradename,
|
|
43
47
|
}),
|
|
44
48
|
);
|
|
45
49
|
|
|
@@ -3,6 +3,7 @@ import { Variation } from "@lookiero/sty-psp-ab-testing";
|
|
|
3
3
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
4
4
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
5
5
|
import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
6
|
+
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
6
7
|
import { ABTestTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
7
8
|
import { PROJECT } from "./tracking";
|
|
8
9
|
|
|
@@ -19,6 +20,7 @@ interface UseTrackAssignedVariationByExperimentFunctionArgs {
|
|
|
19
20
|
readonly country: Country;
|
|
20
21
|
readonly segment: Segment;
|
|
21
22
|
readonly checkoutId: string | undefined;
|
|
23
|
+
readonly tradename: Tradename;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
interface UseTrackAssignedVariationByExperimentFunction {
|
|
@@ -28,6 +30,7 @@ interface UseTrackAssignedVariationByExperimentFunction {
|
|
|
28
30
|
const useTrackAssignedVariationByExperiment: UseTrackAssignedVariationByExperimentFunction = ({
|
|
29
31
|
experimentId,
|
|
30
32
|
country,
|
|
33
|
+
tradename,
|
|
31
34
|
checkoutId,
|
|
32
35
|
segment,
|
|
33
36
|
}) => {
|
|
@@ -44,6 +47,7 @@ const useTrackAssignedVariationByExperiment: UseTrackAssignedVariationByExperime
|
|
|
44
47
|
eventCategory: TrackingEventCategory.NAVIGATION,
|
|
45
48
|
section: PROJECT,
|
|
46
49
|
store: country,
|
|
50
|
+
tradename,
|
|
47
51
|
segment,
|
|
48
52
|
checkoutId,
|
|
49
53
|
experiment: experimentId,
|
|
@@ -52,7 +56,7 @@ const useTrackAssignedVariationByExperiment: UseTrackAssignedVariationByExperime
|
|
|
52
56
|
|
|
53
57
|
emitUserEvent(abTestTrackingEvent);
|
|
54
58
|
},
|
|
55
|
-
[checkoutId, country, emitUserEvent, experimentId, segment],
|
|
59
|
+
[checkoutId, country, tradename, emitUserEvent, experimentId, segment],
|
|
56
60
|
);
|
|
57
61
|
|
|
58
62
|
return trackAssignedVariation;
|
|
@@ -2,6 +2,7 @@ import { renderHook } from "@testing-library/react-native";
|
|
|
2
2
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
3
3
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
4
4
|
import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
5
|
+
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
5
6
|
import { ChangeFeedbackTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
6
7
|
import { TrackingPage } from "./tracking";
|
|
7
8
|
import { useTrackChangeFeedback as sut } from "./useTrackChangeFeedback";
|
|
@@ -11,6 +12,7 @@ jest.mock("@lookiero/sty-psp-tracking");
|
|
|
11
12
|
|
|
12
13
|
const country = Country.ES;
|
|
13
14
|
const segment = Segment.WOMEN;
|
|
15
|
+
const tradename = Tradename.LOOKIERO;
|
|
14
16
|
|
|
15
17
|
const event: ChangeFeedbackTrackingEvent = {
|
|
16
18
|
event: TrackingEventName.CHANGE_FEEDBACK,
|
|
@@ -18,6 +20,7 @@ const event: ChangeFeedbackTrackingEvent = {
|
|
|
18
20
|
section: "checkout_feedback",
|
|
19
21
|
store: country,
|
|
20
22
|
segment,
|
|
23
|
+
tradename,
|
|
21
24
|
checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
|
|
22
25
|
questionId: "9a58c188-73a5-45fb-9df7-607738a5c083",
|
|
23
26
|
questionName: "Question name",
|
|
@@ -34,6 +37,7 @@ describe("useTrackChangeFeedback custom hook", () => {
|
|
|
34
37
|
country,
|
|
35
38
|
checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
|
|
36
39
|
segment,
|
|
40
|
+
tradename,
|
|
37
41
|
}),
|
|
38
42
|
);
|
|
39
43
|
|
|
@@ -2,6 +2,7 @@ import { useCallback } from "react";
|
|
|
2
2
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
3
3
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
4
4
|
import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
5
|
+
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
5
6
|
import { PROJECT, TrackingPage } from "./tracking";
|
|
6
7
|
import { ChangeFeedbackTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
7
8
|
|
|
@@ -19,12 +20,13 @@ interface UseTrackChangeFeedbackArgs {
|
|
|
19
20
|
readonly country: Country;
|
|
20
21
|
readonly checkoutId?: string;
|
|
21
22
|
readonly segment: Segment;
|
|
23
|
+
readonly tradename: Tradename;
|
|
22
24
|
}
|
|
23
25
|
interface UseTrackChangeFeedback {
|
|
24
26
|
(agrs: UseTrackChangeFeedbackArgs): ChangeFeedbackFunction;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
|
-
const useTrackChangeFeedback: UseTrackChangeFeedback = ({ page, country, checkoutId, segment }) => {
|
|
29
|
+
const useTrackChangeFeedback: UseTrackChangeFeedback = ({ page, country, tradename, checkoutId, segment }) => {
|
|
28
30
|
const emitUserEvent = useEmitUserEvent<ChangeFeedbackTrackingEvent>();
|
|
29
31
|
|
|
30
32
|
const changeFeedback: ChangeFeedbackFunction = useCallback(
|
|
@@ -38,6 +40,7 @@ const useTrackChangeFeedback: UseTrackChangeFeedback = ({ page, country, checkou
|
|
|
38
40
|
eventCategory: TrackingEventCategory.NAVIGATION,
|
|
39
41
|
section: `${PROJECT}_${page}`,
|
|
40
42
|
store: country,
|
|
43
|
+
tradename,
|
|
41
44
|
segment,
|
|
42
45
|
checkoutId,
|
|
43
46
|
questionId,
|
|
@@ -47,7 +50,7 @@ const useTrackChangeFeedback: UseTrackChangeFeedback = ({ page, country, checkou
|
|
|
47
50
|
|
|
48
51
|
emitUserEvent(changeFeedbackTrackingEvent);
|
|
49
52
|
},
|
|
50
|
-
[checkoutId, country, emitUserEvent, page, segment],
|
|
53
|
+
[checkoutId, country, tradename, emitUserEvent, page, segment],
|
|
51
54
|
);
|
|
52
55
|
|
|
53
56
|
return changeFeedback;
|
|
@@ -2,6 +2,7 @@ import { renderHook } from "@testing-library/react-native";
|
|
|
2
2
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
3
3
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
4
4
|
import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
5
|
+
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
5
6
|
import { CheckoutStatus } from "../../domain/checkout/model/checkout";
|
|
6
7
|
import { CheckoutItemStatus } from "../../domain/checkoutItem/model/checkoutItem";
|
|
7
8
|
import { Currency } from "../../domain/checkoutItem/model/currency";
|
|
@@ -16,6 +17,7 @@ import { useTrackCheckout as sut } from "./useTrackCheckout";
|
|
|
16
17
|
const mockEmitUserEvent = jest.fn();
|
|
17
18
|
jest.mock("@lookiero/sty-psp-tracking");
|
|
18
19
|
|
|
20
|
+
const tradename = Tradename.LOOKIERO;
|
|
19
21
|
const country = Country.ES;
|
|
20
22
|
const segment = Segment.WOMEN;
|
|
21
23
|
const userId = "80c38da1-7091-483d-a2ad-8f1642211e80";
|
|
@@ -55,6 +57,7 @@ const event: CheckoutTrackingEvent = {
|
|
|
55
57
|
segment,
|
|
56
58
|
checkoutId: checkout.id,
|
|
57
59
|
userId,
|
|
60
|
+
tradename,
|
|
58
61
|
sizeChanges: checkoutItemsReplaced,
|
|
59
62
|
isFirstOrder: order.isFirstOrder,
|
|
60
63
|
ecommerce: {
|
|
@@ -82,6 +85,7 @@ describe("useTrackCheckout custom hook", () => {
|
|
|
82
85
|
pricing,
|
|
83
86
|
subscription,
|
|
84
87
|
userId,
|
|
88
|
+
tradename,
|
|
85
89
|
country,
|
|
86
90
|
segment,
|
|
87
91
|
}),
|
|
@@ -3,6 +3,7 @@ import invariant from "tiny-invariant";
|
|
|
3
3
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
4
4
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
5
5
|
import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
6
|
+
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
6
7
|
import { CheckoutItemStatus } from "../../domain/checkoutItem/model/checkoutItem";
|
|
7
8
|
import { Currency } from "../../domain/checkoutItem/model/currency";
|
|
8
9
|
import { CheckoutProjection } from "../../projection/checkout/checkout";
|
|
@@ -24,6 +25,7 @@ interface UseTrackCheckoutFunctionArgs {
|
|
|
24
25
|
readonly userId: string;
|
|
25
26
|
readonly country: Country;
|
|
26
27
|
readonly segment: Segment;
|
|
28
|
+
readonly tradename: Tradename;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
interface UseTrackCheckoutFunction {
|
|
@@ -38,6 +40,7 @@ const useTrackCheckout: UseTrackCheckoutFunction = ({
|
|
|
38
40
|
segment,
|
|
39
41
|
country,
|
|
40
42
|
userId,
|
|
43
|
+
tradename,
|
|
41
44
|
}) => {
|
|
42
45
|
const emitUserEvent = useEmitUserEvent<CheckoutTrackingEvent>();
|
|
43
46
|
const { coupon, isFirstOrder, orderNumber } = order;
|
|
@@ -59,6 +62,7 @@ const useTrackCheckout: UseTrackCheckoutFunction = ({
|
|
|
59
62
|
segment,
|
|
60
63
|
checkoutId: checkout.id,
|
|
61
64
|
userId,
|
|
65
|
+
tradename,
|
|
62
66
|
sizeChanges: totalReplacedFor,
|
|
63
67
|
isFirstOrder,
|
|
64
68
|
ecommerce: {
|
|
@@ -88,6 +92,7 @@ const useTrackCheckout: UseTrackCheckoutFunction = ({
|
|
|
88
92
|
segment,
|
|
89
93
|
subscription,
|
|
90
94
|
userId,
|
|
95
|
+
tradename,
|
|
91
96
|
]);
|
|
92
97
|
|
|
93
98
|
return trackCheckout;
|
|
@@ -2,6 +2,7 @@ import { renderHook } from "@testing-library/react-native";
|
|
|
2
2
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
3
3
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
4
4
|
import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
5
|
+
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
5
6
|
import { MediaPerspective } from "../../projection/checkoutItem/checkoutItem";
|
|
6
7
|
import { ImageViewTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
7
8
|
import { TrackingPage } from "./tracking";
|
|
@@ -12,6 +13,7 @@ jest.mock("@lookiero/sty-psp-tracking");
|
|
|
12
13
|
|
|
13
14
|
const country = Country.ES;
|
|
14
15
|
const segment = Segment.WOMEN;
|
|
16
|
+
const tradename = Tradename.LOOKIERO;
|
|
15
17
|
|
|
16
18
|
const event: ImageViewTrackingEvent = {
|
|
17
19
|
event: TrackingEventName.IMAGE_VIEW,
|
|
@@ -19,6 +21,7 @@ const event: ImageViewTrackingEvent = {
|
|
|
19
21
|
section: "checkout_item",
|
|
20
22
|
store: country,
|
|
21
23
|
segment,
|
|
24
|
+
tradename,
|
|
22
25
|
checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
|
|
23
26
|
checkoutItemId: "a72120a3-6837-4fe9-adc3-a891b14160ff",
|
|
24
27
|
productVariantId: "5e9dd5b8-b17e-42e4-9824-91a5b9e8745a",
|
|
@@ -34,6 +37,7 @@ describe("useTrackImageView custom hook", () => {
|
|
|
34
37
|
page: TrackingPage.ITEM,
|
|
35
38
|
country,
|
|
36
39
|
segment,
|
|
40
|
+
tradename,
|
|
37
41
|
checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
|
|
38
42
|
checkoutItemId: "a72120a3-6837-4fe9-adc3-a891b14160ff",
|
|
39
43
|
productVariantId: "5e9dd5b8-b17e-42e4-9824-91a5b9e8745a",
|
|
@@ -2,6 +2,7 @@ import { useCallback } from "react";
|
|
|
2
2
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
3
3
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
4
4
|
import { TrackingEventCategory, useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
5
|
+
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
5
6
|
import { MediaPerspective } from "../../projection/checkoutItem/checkoutItem";
|
|
6
7
|
import { ImageViewTrackingEvent, PROJECT, TrackingEventName, TrackingPage } from "./tracking";
|
|
7
8
|
|
|
@@ -19,6 +20,7 @@ interface UseTrackImageViewFunctionArgs {
|
|
|
19
20
|
readonly checkoutId: string | undefined;
|
|
20
21
|
readonly checkoutItemId: string;
|
|
21
22
|
readonly productVariantId: string;
|
|
23
|
+
readonly tradename: Tradename;
|
|
22
24
|
}
|
|
23
25
|
interface UseTrackImageViewFunction {
|
|
24
26
|
(agrs: UseTrackImageViewFunctionArgs): ImageViewFunction;
|
|
@@ -31,6 +33,7 @@ const useTrackImageView: UseTrackImageViewFunction = ({
|
|
|
31
33
|
checkoutId,
|
|
32
34
|
checkoutItemId,
|
|
33
35
|
productVariantId,
|
|
36
|
+
tradename,
|
|
34
37
|
}) => {
|
|
35
38
|
const emitUserEvent = useEmitUserEvent<ImageViewTrackingEvent>();
|
|
36
39
|
|
|
@@ -49,12 +52,13 @@ const useTrackImageView: UseTrackImageViewFunction = ({
|
|
|
49
52
|
checkoutId,
|
|
50
53
|
checkoutItemId,
|
|
51
54
|
productVariantId,
|
|
55
|
+
tradename,
|
|
52
56
|
perspective,
|
|
53
57
|
};
|
|
54
58
|
|
|
55
59
|
emitUserEvent(imageViewTrackingEvent);
|
|
56
60
|
},
|
|
57
|
-
[checkoutId, checkoutItemId, country, emitUserEvent, page, productVariantId, segment],
|
|
61
|
+
[checkoutId, checkoutItemId, country, emitUserEvent, page, productVariantId, tradename, segment],
|
|
58
62
|
);
|
|
59
63
|
|
|
60
64
|
return imageView;
|
|
@@ -2,6 +2,7 @@ import { renderHook } from "@testing-library/react-native";
|
|
|
2
2
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
3
3
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
4
4
|
import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
5
|
+
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
5
6
|
import { CheckoutItemStatus } from "../../domain/checkoutItem/model/checkoutItem";
|
|
6
7
|
import { ItemPageViewTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
7
8
|
import { TrackingPage } from "./tracking";
|
|
@@ -12,6 +13,7 @@ jest.mock("@lookiero/sty-psp-tracking");
|
|
|
12
13
|
|
|
13
14
|
const country = Country.ES;
|
|
14
15
|
const segment = Segment.WOMEN;
|
|
16
|
+
const tradename = Tradename.LOOKIERO;
|
|
15
17
|
|
|
16
18
|
const event: ItemPageViewTrackingEvent = {
|
|
17
19
|
event: TrackingEventName.PAGEVIEW,
|
|
@@ -25,6 +27,7 @@ const event: ItemPageViewTrackingEvent = {
|
|
|
25
27
|
productVariantId: "bec31d70-e03c-4533-93ef-5302a7c96c41",
|
|
26
28
|
replaceableFor: "",
|
|
27
29
|
unique: false,
|
|
30
|
+
tradename,
|
|
28
31
|
};
|
|
29
32
|
|
|
30
33
|
describe("useTrackItemPageView custom hook", () => {
|
|
@@ -42,6 +45,7 @@ describe("useTrackItemPageView custom hook", () => {
|
|
|
42
45
|
productVariantId: "bec31d70-e03c-4533-93ef-5302a7c96c41",
|
|
43
46
|
replaceableFor: [],
|
|
44
47
|
unique: false,
|
|
48
|
+
tradename,
|
|
45
49
|
}),
|
|
46
50
|
);
|
|
47
51
|
|
|
@@ -2,6 +2,7 @@ import { useLayoutEffect } from "react";
|
|
|
2
2
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
3
3
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
4
4
|
import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
5
|
+
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
5
6
|
import { CheckoutItemStatus } from "../../domain/checkoutItem/model/checkoutItem";
|
|
6
7
|
import { ItemPageViewTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
7
8
|
import { PROJECT, TrackingPage } from "./tracking";
|
|
@@ -16,6 +17,7 @@ interface UseTrackItemPageViewFunctionArgs {
|
|
|
16
17
|
readonly replaceableFor: string[] | undefined;
|
|
17
18
|
readonly status: CheckoutItemStatus;
|
|
18
19
|
readonly unique: boolean;
|
|
20
|
+
readonly tradename: Tradename;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
interface UseTrackItemPageViewFunction {
|
|
@@ -32,6 +34,7 @@ const useTrackItemPageView: UseTrackItemPageViewFunction = ({
|
|
|
32
34
|
replaceableFor,
|
|
33
35
|
status,
|
|
34
36
|
unique,
|
|
37
|
+
tradename,
|
|
35
38
|
}) => {
|
|
36
39
|
const emitUserEvent = useEmitUserEvent<ItemPageViewTrackingEvent>();
|
|
37
40
|
|
|
@@ -52,6 +55,7 @@ const useTrackItemPageView: UseTrackItemPageViewFunction = ({
|
|
|
52
55
|
productVariantId,
|
|
53
56
|
replaceableFor: replaceableFor.toString(),
|
|
54
57
|
unique,
|
|
58
|
+
tradename,
|
|
55
59
|
};
|
|
56
60
|
|
|
57
61
|
emitUserEvent(itemPageViewTrackingEvent);
|
|
@@ -66,6 +70,7 @@ const useTrackItemPageView: UseTrackItemPageViewFunction = ({
|
|
|
66
70
|
segment,
|
|
67
71
|
status,
|
|
68
72
|
unique,
|
|
73
|
+
tradename,
|
|
69
74
|
]);
|
|
70
75
|
};
|
|
71
76
|
|
|
@@ -2,6 +2,7 @@ import { renderHook } from "@testing-library/react-native";
|
|
|
2
2
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
3
3
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
4
4
|
import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
5
|
+
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
5
6
|
import { KeepItemTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
6
7
|
import { TrackingPage } from "./tracking";
|
|
7
8
|
import { useTrackKeepItem as sut } from "./useTrackKeepItem";
|
|
@@ -11,6 +12,7 @@ jest.mock("@lookiero/sty-psp-tracking");
|
|
|
11
12
|
|
|
12
13
|
const country = Country.ES;
|
|
13
14
|
const segment = Segment.WOMEN;
|
|
15
|
+
const tradename = Tradename.LOOKIERO;
|
|
14
16
|
|
|
15
17
|
const event: KeepItemTrackingEvent = {
|
|
16
18
|
event: TrackingEventName.KEEP_ITEM,
|
|
@@ -18,6 +20,7 @@ const event: KeepItemTrackingEvent = {
|
|
|
18
20
|
section: "checkout_item",
|
|
19
21
|
store: country,
|
|
20
22
|
segment,
|
|
23
|
+
tradename,
|
|
21
24
|
checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
|
|
22
25
|
checkoutItemId: "a72120a3-6837-4fe9-adc3-a891b14160ff",
|
|
23
26
|
};
|
|
@@ -31,6 +34,7 @@ describe("useTrackKeepItem custom hook", () => {
|
|
|
31
34
|
page: TrackingPage.ITEM,
|
|
32
35
|
country,
|
|
33
36
|
segment,
|
|
37
|
+
tradename,
|
|
34
38
|
checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
|
|
35
39
|
checkoutItemId: "a72120a3-6837-4fe9-adc3-a891b14160ff",
|
|
36
40
|
}),
|
|
@@ -2,6 +2,7 @@ import { useCallback } from "react";
|
|
|
2
2
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
3
3
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
4
4
|
import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
5
|
+
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
5
6
|
import { KeepItemTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
6
7
|
import { PROJECT, TrackingPage } from "./tracking";
|
|
7
8
|
|
|
@@ -15,12 +16,20 @@ interface UseTrackKeepItemFunctionArgs {
|
|
|
15
16
|
readonly segment: Segment;
|
|
16
17
|
readonly checkoutId: string | undefined;
|
|
17
18
|
readonly checkoutItemId: string;
|
|
19
|
+
readonly tradename: Tradename;
|
|
18
20
|
}
|
|
19
21
|
interface UseTrackKeepItemFunction {
|
|
20
22
|
(agrs: UseTrackKeepItemFunctionArgs): KeepItemFunction;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
|
-
const useTrackKeepItem: UseTrackKeepItemFunction = ({
|
|
25
|
+
const useTrackKeepItem: UseTrackKeepItemFunction = ({
|
|
26
|
+
page,
|
|
27
|
+
country,
|
|
28
|
+
tradename,
|
|
29
|
+
segment,
|
|
30
|
+
checkoutId,
|
|
31
|
+
checkoutItemId,
|
|
32
|
+
}) => {
|
|
24
33
|
const emitUserEvent = useEmitUserEvent<KeepItemTrackingEvent>();
|
|
25
34
|
|
|
26
35
|
const keepItem: KeepItemFunction = useCallback(() => {
|
|
@@ -33,13 +42,14 @@ const useTrackKeepItem: UseTrackKeepItemFunction = ({ page, country, segment, ch
|
|
|
33
42
|
eventCategory: TrackingEventCategory.NAVIGATION,
|
|
34
43
|
section: `${PROJECT}_${page}`,
|
|
35
44
|
store: country,
|
|
45
|
+
tradename,
|
|
36
46
|
segment,
|
|
37
47
|
checkoutId,
|
|
38
48
|
checkoutItemId,
|
|
39
49
|
};
|
|
40
50
|
|
|
41
51
|
emitUserEvent(keepItemTrackingEvent);
|
|
42
|
-
}, [checkoutId, checkoutItemId, country, emitUserEvent, page, segment]);
|
|
52
|
+
}, [checkoutId, checkoutItemId, country, tradename, emitUserEvent, page, segment]);
|
|
43
53
|
|
|
44
54
|
return keepItem;
|
|
45
55
|
};
|
|
@@ -2,6 +2,7 @@ import { renderHook } from "@testing-library/react-native";
|
|
|
2
2
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
3
3
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
4
4
|
import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
5
|
+
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
5
6
|
import { TrackingEventName, TrackingEventCategory, PageViewTrackingEvent } from "./tracking";
|
|
6
7
|
import { TrackingPage } from "./tracking";
|
|
7
8
|
import { useTrackPageView as sut } from "./useTrackPageView";
|
|
@@ -12,6 +13,7 @@ jest.mock("@lookiero/sty-psp-tracking");
|
|
|
12
13
|
const checkoutId = "c513ebc8-df68-4f47-b899-8ec0ced84ca8";
|
|
13
14
|
const country = Country.ES;
|
|
14
15
|
const segment = Segment.WOMEN;
|
|
16
|
+
const tradename = Tradename.LOOKIERO;
|
|
15
17
|
|
|
16
18
|
const event: PageViewTrackingEvent = {
|
|
17
19
|
event: TrackingEventName.PAGEVIEW,
|
|
@@ -20,6 +22,7 @@ const event: PageViewTrackingEvent = {
|
|
|
20
22
|
store: country,
|
|
21
23
|
segment,
|
|
22
24
|
checkoutId,
|
|
25
|
+
tradename,
|
|
23
26
|
};
|
|
24
27
|
|
|
25
28
|
describe("useTrackPageView custom hook", () => {
|
|
@@ -32,6 +35,7 @@ describe("useTrackPageView custom hook", () => {
|
|
|
32
35
|
country,
|
|
33
36
|
segment,
|
|
34
37
|
checkoutId,
|
|
38
|
+
tradename,
|
|
35
39
|
}),
|
|
36
40
|
);
|
|
37
41
|
|
|
@@ -2,6 +2,7 @@ import { useLayoutEffect } from "react";
|
|
|
2
2
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
3
3
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
4
4
|
import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
5
|
+
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
5
6
|
import { PROJECT, TrackingPage, PageViewTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
6
7
|
|
|
7
8
|
interface UseTrackPageViewFunctionArgs {
|
|
@@ -9,13 +10,14 @@ interface UseTrackPageViewFunctionArgs {
|
|
|
9
10
|
readonly country: Country;
|
|
10
11
|
readonly segment: Segment;
|
|
11
12
|
readonly checkoutId: string | undefined;
|
|
13
|
+
readonly tradename: Tradename;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
interface UseTrackPageViewFunction {
|
|
15
17
|
(agrs: UseTrackPageViewFunctionArgs): void;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
const useTrackPageView: UseTrackPageViewFunction = ({ page, country, segment, checkoutId }) => {
|
|
20
|
+
const useTrackPageView: UseTrackPageViewFunction = ({ page, country, tradename, segment, checkoutId }) => {
|
|
19
21
|
const emitUserEvent = useEmitUserEvent<PageViewTrackingEvent>();
|
|
20
22
|
|
|
21
23
|
useLayoutEffect(() => {
|
|
@@ -28,12 +30,13 @@ const useTrackPageView: UseTrackPageViewFunction = ({ page, country, segment, ch
|
|
|
28
30
|
eventCategory: TrackingEventCategory.NAVIGATION,
|
|
29
31
|
section: `${PROJECT}_${page}`,
|
|
30
32
|
store: country,
|
|
33
|
+
tradename,
|
|
31
34
|
segment,
|
|
32
35
|
checkoutId,
|
|
33
36
|
};
|
|
34
37
|
|
|
35
38
|
emitUserEvent(pageViewTrackingEvent);
|
|
36
|
-
}, [checkoutId, country, emitUserEvent, page, segment]);
|
|
39
|
+
}, [checkoutId, country, tradename, emitUserEvent, page, segment]);
|
|
37
40
|
};
|
|
38
41
|
|
|
39
42
|
export { useTrackPageView };
|
|
@@ -2,6 +2,7 @@ import { renderHook } from "@testing-library/react-native";
|
|
|
2
2
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
3
3
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
4
4
|
import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
5
|
+
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
5
6
|
import { PressBackTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
6
7
|
import { TrackingPage } from "./tracking";
|
|
7
8
|
import { useTrackPressBack as sut } from "./useTrackPressBack";
|
|
@@ -11,6 +12,7 @@ jest.mock("@lookiero/sty-psp-tracking");
|
|
|
11
12
|
|
|
12
13
|
const country = Country.ES;
|
|
13
14
|
const segment = Segment.WOMEN;
|
|
15
|
+
const tradename = Tradename.LOOKIERO;
|
|
14
16
|
|
|
15
17
|
const event: PressBackTrackingEvent = {
|
|
16
18
|
event: TrackingEventName.PRESS_BACK,
|
|
@@ -18,6 +20,7 @@ const event: PressBackTrackingEvent = {
|
|
|
18
20
|
section: "checkout_item",
|
|
19
21
|
store: country,
|
|
20
22
|
segment,
|
|
23
|
+
tradename,
|
|
21
24
|
checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
|
|
22
25
|
};
|
|
23
26
|
|
|
@@ -30,6 +33,7 @@ describe("useTrackPressBack custom hook", () => {
|
|
|
30
33
|
page: TrackingPage.ITEM,
|
|
31
34
|
country,
|
|
32
35
|
segment,
|
|
36
|
+
tradename,
|
|
33
37
|
checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
|
|
34
38
|
}),
|
|
35
39
|
);
|
|
@@ -2,6 +2,7 @@ import { useCallback } from "react";
|
|
|
2
2
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
3
3
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
4
4
|
import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
5
|
+
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
5
6
|
import { PROJECT, TrackingPage, PressBackTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
6
7
|
|
|
7
8
|
interface PressBackFunction {
|
|
@@ -13,13 +14,14 @@ interface UseTrackPressBackFunctionArgs {
|
|
|
13
14
|
readonly country: Country;
|
|
14
15
|
readonly segment: Segment;
|
|
15
16
|
readonly checkoutId: string | undefined;
|
|
17
|
+
readonly tradename: Tradename;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
interface UseTrackPressBackFunction {
|
|
19
21
|
(args: UseTrackPressBackFunctionArgs): PressBackFunction;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
const useTrackPressBack: UseTrackPressBackFunction = ({ page, country, segment, checkoutId }) => {
|
|
24
|
+
const useTrackPressBack: UseTrackPressBackFunction = ({ page, country, tradename, segment, checkoutId }) => {
|
|
23
25
|
const emitUserEvent = useEmitUserEvent<PressBackTrackingEvent>();
|
|
24
26
|
|
|
25
27
|
const pressBack: PressBackFunction = useCallback(() => {
|
|
@@ -32,12 +34,13 @@ const useTrackPressBack: UseTrackPressBackFunction = ({ page, country, segment,
|
|
|
32
34
|
eventCategory: TrackingEventCategory.NAVIGATION,
|
|
33
35
|
section: `${PROJECT}_${page}`,
|
|
34
36
|
store: country,
|
|
37
|
+
tradename,
|
|
35
38
|
segment,
|
|
36
39
|
checkoutId,
|
|
37
40
|
};
|
|
38
41
|
|
|
39
42
|
emitUserEvent(pressBackTrackingEvent);
|
|
40
|
-
}, [checkoutId, country, emitUserEvent, page, segment]);
|
|
43
|
+
}, [checkoutId, country, tradename, emitUserEvent, page, segment]);
|
|
41
44
|
|
|
42
45
|
return pressBack;
|
|
43
46
|
};
|
|
@@ -2,6 +2,7 @@ import { renderHook } from "@testing-library/react-native";
|
|
|
2
2
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
3
3
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
4
4
|
import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
5
|
+
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
5
6
|
import { PressContinueTrackingEvent, TrackingPage, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
6
7
|
import { useTrackPressContinue as sut } from "./useTrackPressContinue";
|
|
7
8
|
|
|
@@ -10,6 +11,7 @@ jest.mock("@lookiero/sty-psp-tracking");
|
|
|
10
11
|
|
|
11
12
|
const country = Country.ES;
|
|
12
13
|
const segment = Segment.WOMEN;
|
|
14
|
+
const tradename = Tradename.LOOKIERO;
|
|
13
15
|
|
|
14
16
|
const event: PressContinueTrackingEvent = {
|
|
15
17
|
event: TrackingEventName.PRESS_CONTINUE,
|
|
@@ -17,6 +19,7 @@ const event: PressContinueTrackingEvent = {
|
|
|
17
19
|
section: "checkout_item",
|
|
18
20
|
store: country,
|
|
19
21
|
segment,
|
|
22
|
+
tradename,
|
|
20
23
|
checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
|
|
21
24
|
};
|
|
22
25
|
|
|
@@ -29,6 +32,7 @@ describe("useTrackPressContinue custom hook", () => {
|
|
|
29
32
|
page: TrackingPage.ITEM,
|
|
30
33
|
country,
|
|
31
34
|
segment,
|
|
35
|
+
tradename,
|
|
32
36
|
checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
|
|
33
37
|
}),
|
|
34
38
|
);
|
|
@@ -2,6 +2,7 @@ import { useCallback } from "react";
|
|
|
2
2
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
3
3
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
4
4
|
import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
5
|
+
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
5
6
|
import {
|
|
6
7
|
PROJECT,
|
|
7
8
|
TrackingPage,
|
|
@@ -19,12 +20,13 @@ interface UseTrackPressContinueFunctionArgs {
|
|
|
19
20
|
readonly country: Country;
|
|
20
21
|
readonly segment: Segment;
|
|
21
22
|
readonly checkoutId: string | undefined;
|
|
23
|
+
readonly tradename: Tradename;
|
|
22
24
|
}
|
|
23
25
|
interface UseTrackPressContinueFunction {
|
|
24
26
|
(agrs: UseTrackPressContinueFunctionArgs): PressContinueFunction;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
|
-
const useTrackPressContinue: UseTrackPressContinueFunction = ({ page, country, segment, checkoutId }) => {
|
|
29
|
+
const useTrackPressContinue: UseTrackPressContinueFunction = ({ page, country, tradename, segment, checkoutId }) => {
|
|
28
30
|
const emitUserEvent = useEmitUserEvent<PressContinueTrackingEvent>();
|
|
29
31
|
|
|
30
32
|
const pressContinue: PressContinueFunction = useCallback(() => {
|
|
@@ -37,12 +39,13 @@ const useTrackPressContinue: UseTrackPressContinueFunction = ({ page, country, s
|
|
|
37
39
|
eventCategory: TrackingEventCategory.NAVIGATION,
|
|
38
40
|
section: `${PROJECT}_${page}`,
|
|
39
41
|
store: country,
|
|
42
|
+
tradename,
|
|
40
43
|
segment,
|
|
41
44
|
checkoutId,
|
|
42
45
|
};
|
|
43
46
|
|
|
44
47
|
emitUserEvent(pressContinueTrackingEvent);
|
|
45
|
-
}, [checkoutId, country, emitUserEvent, page, segment]);
|
|
48
|
+
}, [checkoutId, country, tradename, emitUserEvent, page, segment]);
|
|
46
49
|
|
|
47
50
|
return pressContinue;
|
|
48
51
|
};
|
|
@@ -2,6 +2,7 @@ import { renderHook } from "@testing-library/react-native";
|
|
|
2
2
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
3
3
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
4
4
|
import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
|
|
5
|
+
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
5
6
|
import { TrackingPage, PressItemTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
|
|
6
7
|
import { useTrackPressItem as sut } from "./useTrackPressItem";
|
|
7
8
|
|
|
@@ -10,6 +11,7 @@ jest.mock("@lookiero/sty-psp-tracking");
|
|
|
10
11
|
|
|
11
12
|
const country = Country.ES;
|
|
12
13
|
const segment = Segment.WOMEN;
|
|
14
|
+
const tradename = Tradename.LOOKIERO;
|
|
13
15
|
|
|
14
16
|
const event: PressItemTrackingEvent = {
|
|
15
17
|
event: TrackingEventName.PRESS_ITEM,
|
|
@@ -17,6 +19,7 @@ const event: PressItemTrackingEvent = {
|
|
|
17
19
|
section: "checkout_item",
|
|
18
20
|
store: country,
|
|
19
21
|
segment,
|
|
22
|
+
tradename,
|
|
20
23
|
checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
|
|
21
24
|
checkoutItemId: "a72120a3-6837-4fe9-adc3-a891b14160ff",
|
|
22
25
|
};
|
|
@@ -30,6 +33,7 @@ describe("useTrackPressItem custom hook", () => {
|
|
|
30
33
|
page: TrackingPage.ITEM,
|
|
31
34
|
country,
|
|
32
35
|
segment,
|
|
36
|
+
tradename,
|
|
33
37
|
checkoutId: "c513ebc8-df68-4f47-b899-8ec0ced84ca8",
|
|
34
38
|
}),
|
|
35
39
|
);
|