@applicaster/zapp-react-native-app 13.0.0-rc.16 → 13.0.0-rc.18

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.
@@ -4,8 +4,8 @@ exports[`Layout should match snapshot when appReady is true 1`] = `
4
4
  <RNCSafeAreaProvider
5
5
  onInsetsChange={[Function]}
6
6
  style={
7
- Array [
8
- Object {
7
+ [
8
+ {
9
9
  "flex": 1,
10
10
  },
11
11
  undefined,
@@ -13,85 +13,66 @@ exports[`Layout should match snapshot when appReady is true 1`] = `
13
13
  }
14
14
  >
15
15
  <View
16
- onLayout={[Function]}
17
16
  style={
18
- Object {
19
- "flex": 1,
17
+ {
18
+ "height": "100%",
20
19
  }
21
20
  }
22
- testID="on-layout-view"
23
21
  >
24
22
  <View
25
- style={
26
- Object {
27
- "display": "none",
28
- "flex": 1,
23
+ contentStyle={
24
+ {
25
+ "height": "100%",
26
+ "opacity": 1,
27
+ "paddingBottom": 50,
29
28
  }
30
29
  }
30
+ isRTL={false}
31
+ testID="transitioner"
32
+ transitionConfig={[Function]}
31
33
  >
32
34
  <View
33
- style={
34
- Object {
35
- "height": "100%",
36
- }
37
- }
38
- >
39
- <View
40
- contentStyle={
41
- Object {
42
- "height": "100%",
43
- "opacity": 1,
44
- "paddingBottom": 50,
45
- }
46
- }
47
- isRTL={false}
48
- testID="transitioner"
49
- transitionConfig={[Function]}
50
- >
51
- <View
52
- pathname="home"
53
- screenData={Object {}}
54
- />
55
- </View>
56
- </View>
57
- <View
58
- bottomTabBarHeight={50}
59
- closeMenu={[MockFunction]}
60
- dimensions={
61
- Object {
62
- "window": Object {
63
- "height": 100,
64
- "width": 100,
65
- },
66
- }
67
- }
68
- id="home"
69
- isRTL={false}
70
- navigator={
71
- Object {
72
- "activeRiver": Object {
73
- "navigations": Array [],
74
- },
75
- "currentRoute": "home",
76
- "data": Object {},
77
- "isVideoModalDocked": false,
78
- "videoModalState": Object {
79
- "mode": "MINIMIZED",
80
- "visible": false,
81
- },
82
- }
83
- }
84
- openMenu={[MockFunction]}
85
- setCloseMenu={[MockFunction]}
86
- setOpenMenu={[MockFunction]}
87
- setToggleMenu={[MockFunction]}
88
- testID="menu"
89
- toggleMenu={[MockFunction]}
90
- />
91
- <View
92
- testID="zappHooksModal"
35
+ pathname="home"
36
+ screenData={{}}
93
37
  />
94
38
  </View>
95
39
  </View>
40
+ <View
41
+ bottomTabBarHeight={50}
42
+ closeMenu={[MockFunction]}
43
+ dimensions={
44
+ {
45
+ "window": {
46
+ "height": 100,
47
+ "width": 100,
48
+ },
49
+ }
50
+ }
51
+ id="home"
52
+ isRTL={false}
53
+ navigator={
54
+ {
55
+ "activeRiver": {
56
+ "navigations": [],
57
+ },
58
+ "currentRoute": "home",
59
+ "data": {},
60
+ "isVideoModalDocked": false,
61
+ "videoModalState": {
62
+ "mode": "MINIMIZED",
63
+ "visible": false,
64
+ },
65
+ }
66
+ }
67
+ openMenu={[MockFunction]}
68
+ setCloseMenu={[MockFunction]}
69
+ setOpenMenu={[MockFunction]}
70
+ setToggleMenu={[MockFunction]}
71
+ testID="menu"
72
+ toggleMenu={[MockFunction]}
73
+ />
74
+ <View
75
+ testID="zappHooksModal"
76
+ />
96
77
  </RNCSafeAreaProvider>
97
78
  `;
@@ -1,5 +1,4 @@
1
1
  import React from "react";
2
- import { View } from "react-native";
3
2
  import { renderWithProviders } from "@applicaster/zapp-react-native-utils/testUtils";
4
3
 
5
4
  const mockUseMenuToggleContext = jest.fn(() => ({
@@ -11,25 +10,38 @@ const mockUseMenuToggleContext = jest.fn(() => ({
11
10
  setCloseMenu: jest.fn(),
12
11
  }));
13
12
 
14
- jest.mock("../layoutHelpers", () => ({
15
- // eslint-disable-next-line react/display-name
16
- getNavigationPluginModule: () => (props) => <View testID="menu" {...props} />,
17
- }));
13
+ jest.mock("../layoutHelpers", () => {
14
+ const { View } = jest.requireActual("react-native");
15
+
16
+ return {
17
+ // eslint-disable-next-line react/display-name
18
+ getNavigationPluginModule: () => (props) =>
19
+ <View testID="menu" {...props} />,
20
+ };
21
+ });
18
22
 
19
23
  jest.mock(
20
24
  "@applicaster/zapp-react-native-ui-components/Components/Transitioner",
21
- () => ({
22
- // eslint-disable-next-line react/display-name
23
- Transitioner: (props) => <View testID="transitioner" {...props} />,
24
- })
25
+ () => {
26
+ const { View } = jest.requireActual("react-native");
27
+
28
+ return {
29
+ // eslint-disable-next-line react/display-name
30
+ Transitioner: (props) => <View testID="transitioner" {...props} />,
31
+ };
32
+ }
25
33
  );
26
34
 
27
35
  jest.mock(
28
36
  "@applicaster/zapp-react-native-ui-components/Components/Screen",
29
- () => ({
30
- // eslint-disable-next-line react/display-name
31
- Screen: (props) => <View {...props} />,
32
- })
37
+ () => {
38
+ const { View } = jest.requireActual("react-native");
39
+
40
+ return {
41
+ // eslint-disable-next-line react/display-name
42
+ Screen: (props) => <View {...props} />,
43
+ };
44
+ }
33
45
  );
34
46
 
35
47
  jest.mock(
@@ -48,12 +60,12 @@ jest.mock(
48
60
  })
49
61
  );
50
62
 
51
- jest.mock("@applicaster/zapp-react-native-utils/reactHooks/navigation", () => ({
52
- ...(jest.requireActual(
53
- "@applicaster/zapp-react-native-utils/reactHooks/navigation"
54
- ) as {}),
55
- useGetBottomTabBarHeight: jest.fn(() => 50),
56
- }));
63
+ jest.mock(
64
+ "@applicaster/zapp-react-native-utils/reactHooks/navigation/useGetBottomTabBarHeight",
65
+ () => ({
66
+ useGetBottomTabBarHeight: jest.fn(() => 50),
67
+ })
68
+ );
57
69
 
58
70
  jest.mock(
59
71
  "@applicaster/zapp-react-native-utils/reactHooks/layout/useDimensions",
@@ -74,17 +86,25 @@ jest.mock("@applicaster/zapp-react-native-utils/localizationUtils", () => ({
74
86
  }));
75
87
 
76
88
  jest.mock(
77
- "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation/ModalAnimationContext",
89
+ "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation",
90
+ () => ({
91
+ withModalAnimationProvider: jest.fn((Component) => Component),
92
+ })
93
+ );
94
+
95
+ jest.mock(
96
+ "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation/useModalAnimationContext",
78
97
  () => ({
79
- ...(jest.requireActual(
80
- "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation/ModalAnimationContext"
81
- ) as {}),
82
98
  useModalAnimationContext: jest.fn(() => ({
83
99
  isActiveGesture: false,
84
100
  })),
85
101
  })
86
102
  );
87
103
 
104
+ jest.mock("@applicaster/zapp-react-native-utils/dimensionsProvider", () => ({
105
+ withDimensionsProvider: jest.fn((Component) => Component),
106
+ }));
107
+
88
108
  jest.mock(
89
109
  "@applicaster/zapp-react-native-ui-components/Components/Screen/navigationHandler",
90
110
  () => ({
@@ -94,18 +114,26 @@ jest.mock(
94
114
 
95
115
  jest.mock(
96
116
  "@applicaster/zapp-react-dom-ui-components/Components/ZappHooksModal",
97
- () => ({
98
- // eslint-disable-next-line react/display-name
99
- ZappHooksModal: (props) => <View testID="zappHooksModal" {...props} />,
100
- })
117
+ () => {
118
+ const { View } = jest.requireActual("react-native");
119
+
120
+ return {
121
+ // eslint-disable-next-line react/display-name
122
+ ZappHooksModal: (props) => <View testID="zappHooksModal" {...props} />,
123
+ };
124
+ }
101
125
  );
102
126
 
103
127
  jest.mock(
104
128
  "@applicaster/zapp-react-native-ui-components/Components/VideoModal",
105
- () => ({
106
- // eslint-disable-next-line react/display-name
107
- VideoModal: (props) => <View testID="videoModal" {...props} />,
108
- })
129
+ () => {
130
+ const { View } = jest.requireActual("react-native");
131
+
132
+ return {
133
+ // eslint-disable-next-line react/display-name
134
+ VideoModal: (props) => <View testID="videoModal" {...props} />,
135
+ };
136
+ }
109
137
  );
110
138
 
111
139
  jest.mock("@applicaster/zapp-react-native-utils/navigationUtils", () => ({
@@ -118,6 +146,16 @@ jest.mock("@applicaster/zapp-react-native-utils/navigationUtils", () => ({
118
146
  const { Layout } = require("../");
119
147
 
120
148
  describe("Layout", () => {
149
+ beforeAll(() => {
150
+ mockUseNavigation.mockImplementation(() => ({
151
+ activeRiver: { navigations: [] },
152
+ videoModalState: { visible: false, mode: "MINIMIZED" },
153
+ isVideoModalDocked: false,
154
+ currentRoute: "home",
155
+ data: {},
156
+ }));
157
+ });
158
+
121
159
  beforeEach(() => {
122
160
  jest.clearAllMocks();
123
161
 
@@ -132,6 +170,7 @@ describe("Layout", () => {
132
170
 
133
171
  it("should match snapshot when appReady is true", () => {
134
172
  const { toJSON } = renderWithProviders(<Layout />);
173
+
135
174
  expect(toJSON()).toMatchSnapshot();
136
175
  });
137
176
 
@@ -147,8 +186,8 @@ describe("Layout", () => {
147
186
  });
148
187
 
149
188
  it("should render menu when showMenu is true", () => {
150
- const { getByTestId } = renderWithProviders(<Layout />);
151
- expect(getByTestId("menu")).toBeTruthy();
189
+ const { queryByTestId } = renderWithProviders(<Layout />);
190
+ expect(queryByTestId("menu")).toBeTruthy();
152
191
  });
153
192
 
154
193
  it("should render VideoModal when visible & VideoModal is true", () => {
@@ -180,9 +219,9 @@ describe("Layout", () => {
180
219
 
181
220
  const { getByTestId } = renderWithProviders(<Layout />);
182
221
 
183
- expect(getByTestId("transitioner").props.contentStyle.paddingBottom).toBe(
184
- 50
185
- );
222
+ return expect(
223
+ getByTestId("transitioner").props.contentStyle.paddingBottom
224
+ ).toBe(50);
186
225
  });
187
226
 
188
227
  it("transitioner should have contentStyle with specific styles", () => {
@@ -29,10 +29,8 @@ import {
29
29
  } from "@applicaster/zapp-react-native-ui-components/Contexts/MenuToggleContext";
30
30
  import { VideoModal } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal";
31
31
  import { withDimensionsProvider } from "@applicaster/zapp-react-native-utils/dimensionsProvider";
32
- import {
33
- withModalAnimationProvider,
34
- useModalAnimationContext,
35
- } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
32
+ import { withModalAnimationProvider } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
33
+ import { useModalAnimationContext } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation/useModalAnimationContext";
36
34
 
37
35
  import { ZappHooksModal } from "@applicaster/zapp-react-dom-ui-components/Components/ZappHooksModal";
38
36
  import { useListenEventBusEvent } from "@applicaster/zapp-react-native-utils/reactHooks/useListenEventBusEvent";
@@ -6,33 +6,33 @@ exports[`<ZappApp /> renders correctly 1`] = `
6
6
  >
7
7
  <WithContextProviderComponent
8
8
  appSettings={
9
- Object {
10
- "runtimeConfigurationUrls": Object {
9
+ {
10
+ "runtimeConfigurationUrls": {
11
11
  "cell_styles_url": "http://zapp.com/cell_styles.json",
12
12
  },
13
13
  }
14
14
  }
15
15
  components={
16
- Object {
16
+ {
17
17
  "AppContainer": [Function],
18
18
  "Screen": [Function],
19
19
  }
20
20
  }
21
21
  dispatch={[Function]}
22
22
  rivers={
23
- Array [
24
- Object {
23
+ [
24
+ {
25
25
  "home": false,
26
26
  "id": "1",
27
27
  },
28
- Object {
28
+ {
29
29
  "home": true,
30
30
  "id": 2,
31
31
  },
32
32
  ]
33
33
  }
34
34
  store={
35
- Object {
35
+ {
36
36
  "clearActions": [Function],
37
37
  "dispatch": [Function],
38
38
  "getActions": [Function],
@@ -42,7 +42,7 @@ exports[`<ZappApp /> renders correctly 1`] = `
42
42
  }
43
43
  }
44
44
  styles={
45
- Object {
45
+ {
46
46
  "color": "blue",
47
47
  }
48
48
  }
@@ -8,7 +8,7 @@ const MockNetInfo = {
8
8
  connection: { type: "none " },
9
9
  };
10
10
 
11
- class NativeEventEmitter {
11
+ class mockNativeEventEmitter {
12
12
  constructor(eventEmitter) {
13
13
  this.eventEmitter = eventEmitter;
14
14
  this.listeners = [];
@@ -98,7 +98,7 @@ jest.mock("react-native", () => {
98
98
  },
99
99
  UIManager: {},
100
100
  },
101
- NativeEventEmitter: NativeEventEmitter,
101
+ NativeEventEmitter: mockNativeEventEmitter,
102
102
  Easing: {
103
103
  in: jest.fn(),
104
104
  bezier: jest.fn(),
@@ -111,13 +111,9 @@ jest.mock("react-native", () => {
111
111
  };
112
112
  });
113
113
 
114
- jest.mock("react-native-svg", () => {
115
- const SvgXml = (props) => <View {...props} mock="SvgXml" />;
116
-
117
- return { SvgXml };
118
- });
119
-
120
114
  jest.mock("react-native-webview", () => {
115
+ const { View } = jest.requireActual("react-native");
116
+
121
117
  return {
122
118
  WebView: jest.fn(() => <View mock="react-native-webview" />),
123
119
  };
@@ -133,7 +129,8 @@ const store = configureStore()({});
133
129
  const Screen = () => <View />;
134
130
  Screen.displayName = "Screen";
135
131
 
136
- const AppContainer = ({ children }: any) => <View>{children(dimensions)}</View>;
132
+ // eslint-disable-next-line react/prop-types
133
+ const AppContainer = ({ children }) => <View>{children(dimensions)}</View>;
137
134
  AppContainer.displayName = "AppContainer";
138
135
 
139
136
  const runtimeConfigurationUrls = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-app",
3
- "version": "13.0.0-rc.16",
3
+ "version": "13.0.0-rc.18",
4
4
  "description": "Zapp App Component for Applicaster's Quick Brick React Native App",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -28,11 +28,11 @@
28
28
  },
29
29
  "homepage": "https://github.com/applicaster/quickbrick#readme",
30
30
  "dependencies": {
31
- "@applicaster/quick-brick-core": "13.0.0-rc.16",
32
- "@applicaster/zapp-react-native-bridge": "13.0.0-rc.16",
33
- "@applicaster/zapp-react-native-redux": "13.0.0-rc.16",
34
- "@applicaster/zapp-react-native-ui-components": "13.0.0-rc.16",
35
- "@applicaster/zapp-react-native-utils": "13.0.0-rc.16",
31
+ "@applicaster/quick-brick-core": "13.0.0-rc.18",
32
+ "@applicaster/zapp-react-native-bridge": "13.0.0-rc.18",
33
+ "@applicaster/zapp-react-native-redux": "13.0.0-rc.18",
34
+ "@applicaster/zapp-react-native-ui-components": "13.0.0-rc.18",
35
+ "@applicaster/zapp-react-native-utils": "13.0.0-rc.18",
36
36
  "axios": "^0.28.0",
37
37
  "camelize": "^1.0.0",
38
38
  "query-string": "7.1.3",
@@ -40,8 +40,28 @@
40
40
  "url": "^0.11.0"
41
41
  },
42
42
  "peerDependencies": {
43
+ "@applicaster/blur": "*",
44
+ "@applicaster/quick-brick-xray": "*",
45
+ "@applicaster/zapp-pipes-v2-client": "*",
46
+ "@applicaster/zapp-react-dom-ui-components": "*",
47
+ "@applicaster/zapp-react-native-tvos-app": "*",
48
+ "@applicaster/zapp-react-native-tvos-ui-components": "*",
49
+ "@babel/runtime": "*",
50
+ "@react-native-community/netinfo": "*",
51
+ "@types/node": "*",
52
+ "immer": "*",
43
53
  "react": "17.0.2",
44
- "react-native": "0.68.6"
54
+ "react-native": "0.68.6",
55
+ "react-native-fs": "*",
56
+ "react-native-gesture-handler": "*",
57
+ "react-native-linear-gradient": "*",
58
+ "react-native-safe-area-context": "*",
59
+ "react-native-svg": "*",
60
+ "react-native-web": "*",
61
+ "react-native-webview": "*",
62
+ "uglify-js": "*",
63
+ "validate-color": "*",
64
+ "zustand": "*"
45
65
  },
46
66
  "devDependencies": {
47
67
  "nock": "^10.0.0",