@lookiero/checkout 13.0.0-beta.0 → 13.0.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 CHANGED
@@ -1,5 +1,4 @@
1
1
  import { ComponentType } from "react";
2
- import { OnSuccessFunction } from "src/infrastructure/ui/hooks/useCheckoutFlow";
3
2
  import { EndpointFunction } from "@lookiero/i18n";
4
3
  import { translationEndpoint, translationExternalEndpoint, Project } from "@lookiero/sty-psp-i18n";
5
4
  import { Country, Locale } from "@lookiero/sty-psp-locale";
@@ -9,6 +8,7 @@ import { Tradename } from "@lookiero/sty-sp-tradename";
9
8
  import { CheckoutStatus } from "./src/domain/checkout/model/checkout";
10
9
  import { KameleoonEnvironment } from "./src/infrastructure/ab-testing/kameleoonEnvironment";
11
10
  import { RootProps } from "./src/infrastructure/ui/Root";
11
+ import { OnSuccessFunction } from "./src/infrastructure/ui/hooks/useCheckoutFlow";
12
12
  import { CheckoutProjection } from "./src/projection/checkout/checkout";
13
13
  import { Customer } from "./src/projection/customer/customer";
14
14
  interface FirstAvailableCheckoutByCustomerIdFunctionArgs {
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "13.0.0-beta.0";
2
- export declare const RELEASE = "checkout@13.0.0-beta.0";
1
+ export declare const VERSION = "13.0.0";
2
+ export declare const RELEASE = "checkout@13.0.0";
@@ -1,2 +1,2 @@
1
- export const VERSION = "13.0.0-beta.0";
2
- export const RELEASE = "checkout@13.0.0-beta.0";
1
+ export const VERSION = "13.0.0";
2
+ export const RELEASE = "checkout@13.0.0";
package/index.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { ComponentType } from "react";
2
- import { OnSuccessFunction } from "src/infrastructure/ui/hooks/useCheckoutFlow";
3
2
  import { EndpointFunction } from "@lookiero/i18n";
4
3
  import { i18n } from "@lookiero/i18n-react";
5
4
  import { fetchTranslations, translationEndpoint, translationExternalEndpoint, Project } from "@lookiero/sty-psp-i18n";
@@ -11,6 +10,7 @@ import { CheckoutStatus } from "./src/domain/checkout/model/checkout";
11
10
  import { KameleoonEnvironment } from "./src/infrastructure/ab-testing/kameleoonEnvironment";
12
11
  import { bootstrap as checkoutBootstrap } from "./src/infrastructure/delivery/bootstrap";
13
12
  import { root, RootProps } from "./src/infrastructure/ui/Root";
13
+ import { OnSuccessFunction } from "./src/infrastructure/ui/hooks/useCheckoutFlow";
14
14
  import { DOMAIN } from "./src/infrastructure/ui/i18n/i18n";
15
15
  import { CheckoutProjection } from "./src/projection/checkout/checkout";
16
16
  import { viewFirstAvailableCheckoutByCustomerId } from "./src/projection/checkout/viewFirstAvailableCheckoutByCustomerId";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "13.0.0-beta.0",
3
+ "version": "13.0.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": "false",
@@ -1,30 +1,21 @@
1
1
  import { renderHook } from "@testing-library/react-native";
2
2
  import { Country, Currency } from "@lookiero/sty-psp-locale";
3
3
  import { Segment } from "@lookiero/sty-psp-segment";
4
- import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
5
4
  import { Tradename } from "@lookiero/sty-sp-tradename";
6
5
  import { CheckoutStatus } from "../../domain/checkout/model/checkout";
7
6
  import { CheckoutItemStatus } from "../../domain/checkoutItem/model/checkoutItem";
8
7
  import { CheckoutProjection } from "../../projection/checkout/checkout";
9
- import { OrderProjection } from "../../projection/order/order";
10
8
  import { PricingProjection } from "../../projection/pricing/pricing";
11
- import { SubscriptionProjection } from "../../projection/subscription/subscription";
12
9
  import { checkout as checkoutMock } from "../projection/checkout/checkout.mock";
13
10
  import { CheckoutTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
14
11
  import { useTrackCheckout as sut } from "./useTrackCheckout";
15
12
 
16
- const mockEmitUserEvent = jest.fn();
17
13
  jest.mock("@lookiero/sty-psp-tracking");
18
14
 
19
15
  const tradename = Tradename.LOOKIERO;
20
16
  const country = Country.ES;
21
17
  const segment = Segment.WOMEN;
22
18
  const userId = "80c38da1-7091-483d-a2ad-8f1642211e80";
23
- const order: OrderProjection = {
24
- coupon: null,
25
- isFirstOrder: false,
26
- orderNumber: 3691625,
27
- };
28
19
  const checkoutItemsReturned = 1;
29
20
  const checkoutItemsKept = 2;
30
21
  const checkoutItemsReplaced = 2;
@@ -46,7 +37,6 @@ const pricing: PricingProjection = {
46
37
  currency: Currency.EUR,
47
38
  },
48
39
  } as PricingProjection;
49
- const subscription: SubscriptionProjection = "b";
50
40
 
51
41
  const event: CheckoutTrackingEvent = {
52
42
  event: TrackingEventName.CHECKOUT,
@@ -58,15 +48,11 @@ const event: CheckoutTrackingEvent = {
58
48
  userId,
59
49
  tradename,
60
50
  sizeChanges: checkoutItemsReplaced,
61
- isFirstOrder: order.isFirstOrder,
62
51
  ecommerce: {
63
52
  checkout: {
64
53
  actionField: {
65
54
  items: checkoutItemsKept + checkoutItemsReplaced,
66
55
  currencyCode: pricing.pendingToPay.currency,
67
- subscription,
68
- coupon: order.coupon,
69
- orderId: order.orderNumber,
70
56
  value: pricing.pendingToPay.amount / 100,
71
57
  },
72
58
  },
@@ -75,14 +61,10 @@ const event: CheckoutTrackingEvent = {
75
61
 
76
62
  describe("useTrackCheckout custom hook", () => {
77
63
  test("renders correctly", () => {
78
- (useEmitUserEvent as jest.Mock).mockImplementation(() => mockEmitUserEvent);
79
-
80
64
  const { result } = renderHook(() =>
81
65
  sut({
82
- order,
83
66
  checkout,
84
67
  pricing,
85
- subscription,
86
68
  userId,
87
69
  tradename,
88
70
  country,
@@ -90,8 +72,8 @@ describe("useTrackCheckout custom hook", () => {
90
72
  }),
91
73
  );
92
74
 
93
- result.current();
75
+ const resultEvent = result.current();
94
76
 
95
- expect(mockEmitUserEvent).toHaveBeenCalledWith(event);
77
+ expect(resultEvent).toEqual(event);
96
78
  });
97
79
  });
Binary file
@@ -1,6 +0,0 @@
1
- interface Order {
2
- readonly orderNumber: number;
3
- readonly isFirstOrder: boolean;
4
- readonly coupon: string | null;
5
- }
6
- export type { Order as OrderProjection };
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- type Subscription = "o" | "m" | "b" | "q";
2
- export type { Subscription as SubscriptionProjection };
@@ -1 +0,0 @@
1
- export {};