@jobber/components-native 0.48.0 → 0.48.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.48.0",
3
+ "version": "0.48.1",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -84,5 +84,5 @@
84
84
  "react-native-reanimated": "^2.17.0",
85
85
  "react-native-safe-area-context": "^4.5.2"
86
86
  },
87
- "gitHead": "faaa9887b344a34eb2760e71fee532145e2dbe81"
87
+ "gitHead": "d8214fde2dedb50cebe48fe7967019660a1933bd"
88
88
  }
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-unused-vars */
2
2
  import React, { PropsWithChildren } from "react";
3
- import { cleanup, renderHook } from "@testing-library/react-hooks";
3
+ import { renderHook } from "@testing-library/react-hooks";
4
4
  import {
5
5
  AtlantisContext,
6
6
  AtlantisContextProps,
@@ -8,8 +8,6 @@ import {
8
8
  useAtlantisContext,
9
9
  } from "./AtlantisContext";
10
10
 
11
- afterEach(cleanup);
12
-
13
11
  const providerValues: AtlantisContextProps = {
14
12
  dateFormat: "MM/DD/YYYY",
15
13
  timeFormat: "hh:mm a",
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { cleanup, render } from "@testing-library/react-native";
2
+ import { render } from "@testing-library/react-native";
3
3
  import {
4
4
  InternalButtonLoading,
5
5
  darkPattern,
@@ -7,8 +7,6 @@ import {
7
7
  } from "./InternalButtonLoading";
8
8
  import { ButtonType, ButtonVariation } from "../../types";
9
9
 
10
- afterEach(cleanup);
11
-
12
10
  describe("Loading pattern", () => {
13
11
  it.each<[string, ButtonType, ButtonVariation]>([
14
12
  [lightPattern, "primary", "work"],
@@ -1,7 +1,6 @@
1
1
  import React from "react";
2
2
  import {
3
3
  RenderAPI,
4
- cleanup,
5
4
  fireEvent,
6
5
  render,
7
6
  waitFor,
@@ -31,8 +30,6 @@ interface CheckboxGroupFormOnChangeHandlers {
31
30
  all?: (data: CheckboxGroupState) => void;
32
31
  }
33
32
 
34
- afterEach(cleanup);
35
-
36
33
  function setup(
37
34
  label: string | undefined,
38
35
  disabled?: boolean,
@@ -71,8 +68,8 @@ function SetupWithForm({
71
68
  initialValues,
72
69
  onChangeHandlers,
73
70
  }: {
74
- initialValues: CheckboxGroupFormData;
75
- onChangeHandlers?: CheckboxGroupFormOnChangeHandlers;
71
+ readonly initialValues: CheckboxGroupFormData;
72
+ readonly onChangeHandlers?: CheckboxGroupFormOnChangeHandlers;
76
73
  }): JSX.Element {
77
74
  const formMethods = useForm({ defaultValues: initialValues });
78
75
 
@@ -178,6 +175,7 @@ describe("when all of the checkboxes in a group are checked", () => {
178
175
  describe("when the parent checkbox does not have a label", () => {
179
176
  it("does not render the parent checkbox", async () => {
180
177
  const { checkboxGroup } = setup(undefined);
178
+
181
179
  const findParentCheckbox = () => {
182
180
  checkboxGroup.getByLabelText(parentCheckboxLabel);
183
181
  };
@@ -1,10 +1,8 @@
1
1
  import React from "react";
2
- import { cleanup, render } from "@testing-library/react-native";
2
+ import { render } from "@testing-library/react-native";
3
3
  import { Divider } from "./Divider";
4
4
  import { styles } from "./Divider.style";
5
5
 
6
- afterEach(cleanup);
7
-
8
6
  const dividerTestId = "Divider";
9
7
 
10
8
  describe("Divider", () => {
@@ -1,9 +1,11 @@
1
1
  import React from "react";
2
- import { cleanup, render } from "@testing-library/react-native";
2
+ import { render } from "@testing-library/react-native";
3
3
  import { FormErrorBanner } from "./FormErrorBanner";
4
4
  import { atlantisContextDefaultValues } from "../../../AtlantisContext";
5
5
  import * as atlantisContext from "../../../AtlantisContext/AtlantisContext";
6
6
 
7
+ afterEach(jest.clearAllMocks);
8
+
7
9
  describe("FormErrorBanner", () => {
8
10
  const atlantisContextSpy = jest.spyOn(atlantisContext, "useAtlantisContext");
9
11
 
@@ -56,6 +58,3 @@ describe("FormErrorBanner", () => {
56
58
  expect(queryByText(couldNotSavechanges)).toBeNull();
57
59
  });
58
60
  });
59
-
60
- afterEach(jest.clearAllMocks);
61
- afterEach(cleanup);
@@ -1,10 +1,5 @@
1
1
  import React from "react";
2
- import {
3
- cleanup,
4
- fireEvent,
5
- render,
6
- waitFor,
7
- } from "@testing-library/react-native";
2
+ import { fireEvent, render, waitFor } from "@testing-library/react-native";
8
3
  import { InputSearch } from "./InputSearch";
9
4
 
10
5
  const accessibilityLabelSearch = "Search";
@@ -18,7 +13,6 @@ beforeEach(() => {
18
13
  mockOnDebouncedChange.mockReset();
19
14
  searchValue = "";
20
15
  });
21
- afterEach(cleanup);
22
16
 
23
17
  function setup() {
24
18
  return render(
@@ -1,10 +1,5 @@
1
1
  import React from "react";
2
- import {
3
- cleanup,
4
- fireEvent,
5
- render,
6
- waitFor,
7
- } from "@testing-library/react-native";
2
+ import { fireEvent, render, waitFor } from "@testing-library/react-native";
8
3
  import { Host } from "react-native-portalize";
9
4
  import { FormProvider, useForm } from "react-hook-form";
10
5
  import { InputTime } from "./InputTime";
@@ -12,7 +7,6 @@ import * as atlantisContext from "../AtlantisContext/AtlantisContext";
12
7
  import { Button } from "../Button";
13
8
 
14
9
  afterEach(() => {
15
- cleanup();
16
10
  jest.spyOn(atlantisContext, "useAtlantisContext").mockRestore();
17
11
  });
18
12
 
@@ -192,6 +186,7 @@ const mockOnSubmit = jest.fn();
192
186
  const saveButtonText = "Submit";
193
187
 
194
188
  const requiredError = "This is required";
189
+
195
190
  function SimpleFormWithProvider({ children, defaultValues }) {
196
191
  const formMethods = useForm({
197
192
  reValidateMode: "onChange",
@@ -1,10 +1,5 @@
1
1
  import React from "react";
2
- import {
3
- RenderAPI,
4
- cleanup,
5
- fireEvent,
6
- render,
7
- } from "@testing-library/react-native";
2
+ import { RenderAPI, fireEvent, render } from "@testing-library/react-native";
8
3
  import { tokens } from "@jobber/design/foundation";
9
4
  import { AccessibilityInfo } from "react-native";
10
5
  import { Option, Select } from ".";
@@ -19,7 +14,6 @@ beforeEach(() => {
19
14
  });
20
15
 
21
16
  afterEach(() => {
22
- cleanup();
23
17
  jest.resetAllMocks();
24
18
  });
25
19
 
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { cleanup, fireEvent, render } from "@testing-library/react-native";
2
+ import { fireEvent, render } from "@testing-library/react-native";
3
3
  import { AccessibilityInfo, View } from "react-native";
4
4
  import { SelectDefaultPicker } from "./SelectDefaultPicker";
5
5
  import { Text } from "../../../Text";
@@ -19,11 +19,11 @@ beforeEach(() => {
19
19
  });
20
20
 
21
21
  afterEach(() => {
22
- cleanup();
23
22
  jest.resetAllMocks();
24
23
  });
25
24
 
26
25
  const childText = "Click me";
26
+
27
27
  function setup() {
28
28
  return render(
29
29
  <View testID="SelectDefaultPicker">
@@ -1,5 +1,5 @@
1
1
  import React, { ElementType } from "react";
2
- import { cleanup, fireEvent, render } from "@testing-library/react-native";
2
+ import { fireEvent, render } from "@testing-library/react-native";
3
3
  import { View } from "react-native";
4
4
  import { SelectInternalPicker } from ".";
5
5
  import { SelectInternalPickerProps } from "../../types";
@@ -19,7 +19,6 @@ jest.mock("@react-native-picker/picker", () => ({ Picker: MockPicker }));
19
19
  MockPicker.Item = MockPickerItem;
20
20
 
21
21
  afterEach(() => {
22
- cleanup();
23
22
  jest.resetAllMocks();
24
23
  });
25
24