@applicaster/zapp-react-native-app 13.0.0-alpha.9270615060 → 13.0.0-alpha.9814200105

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,39 @@ 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
+ };
22
+ });
18
23
 
19
24
  jest.mock(
20
25
  "@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
- })
26
+ () => {
27
+ const { View } = jest.requireActual("react-native");
28
+
29
+ return {
30
+ // eslint-disable-next-line react/display-name
31
+ Transitioner: (props) => <View testID="transitioner" {...props} />,
32
+ };
33
+ }
25
34
  );
26
35
 
27
36
  jest.mock(
28
37
  "@applicaster/zapp-react-native-ui-components/Components/Screen",
29
- () => ({
30
- // eslint-disable-next-line react/display-name
31
- Screen: (props) => <View {...props} />,
32
- })
38
+ () => {
39
+ const { View } = jest.requireActual("react-native");
40
+
41
+ return {
42
+ // eslint-disable-next-line react/display-name
43
+ Screen: (props) => <View {...props} />,
44
+ };
45
+ }
33
46
  );
34
47
 
35
48
  jest.mock(
@@ -48,12 +61,12 @@ jest.mock(
48
61
  })
49
62
  );
50
63
 
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
- }));
64
+ jest.mock(
65
+ "@applicaster/zapp-react-native-utils/reactHooks/navigation/useGetBottomTabBarHeight",
66
+ () => ({
67
+ useGetBottomTabBarHeight: jest.fn(() => 50),
68
+ })
69
+ );
57
70
 
58
71
  jest.mock(
59
72
  "@applicaster/zapp-react-native-utils/reactHooks/layout/useDimensions",
@@ -74,17 +87,25 @@ jest.mock("@applicaster/zapp-react-native-utils/localizationUtils", () => ({
74
87
  }));
75
88
 
76
89
  jest.mock(
77
- "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation/ModalAnimationContext",
90
+ "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation",
91
+ () => ({
92
+ withModalAnimationProvider: jest.fn((Component) => Component),
93
+ })
94
+ );
95
+
96
+ jest.mock(
97
+ "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation/useModalAnimationContext",
78
98
  () => ({
79
- ...(jest.requireActual(
80
- "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation/ModalAnimationContext"
81
- ) as {}),
82
99
  useModalAnimationContext: jest.fn(() => ({
83
100
  isActiveGesture: false,
84
101
  })),
85
102
  })
86
103
  );
87
104
 
105
+ jest.mock("@applicaster/zapp-react-native-utils/dimensionsProvider", () => ({
106
+ withDimensionsProvider: jest.fn((Component) => Component),
107
+ }));
108
+
88
109
  jest.mock(
89
110
  "@applicaster/zapp-react-native-ui-components/Components/Screen/navigationHandler",
90
111
  () => ({
@@ -94,18 +115,26 @@ jest.mock(
94
115
 
95
116
  jest.mock(
96
117
  "@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
- })
118
+ () => {
119
+ const { View } = jest.requireActual("react-native");
120
+
121
+ return {
122
+ // eslint-disable-next-line react/display-name
123
+ ZappHooksModal: (props) => <View testID="zappHooksModal" {...props} />,
124
+ };
125
+ }
101
126
  );
102
127
 
103
128
  jest.mock(
104
129
  "@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
- })
130
+ () => {
131
+ const { View } = jest.requireActual("react-native");
132
+
133
+ return {
134
+ // eslint-disable-next-line react/display-name
135
+ VideoModal: (props) => <View testID="videoModal" {...props} />,
136
+ };
137
+ }
109
138
  );
110
139
 
111
140
  jest.mock("@applicaster/zapp-react-native-utils/navigationUtils", () => ({
@@ -118,6 +147,16 @@ jest.mock("@applicaster/zapp-react-native-utils/navigationUtils", () => ({
118
147
  const { Layout } = require("../");
119
148
 
120
149
  describe("Layout", () => {
150
+ beforeAll(() => {
151
+ mockUseNavigation.mockImplementation(() => ({
152
+ activeRiver: { navigations: [] },
153
+ videoModalState: { visible: false, mode: "MINIMIZED" },
154
+ isVideoModalDocked: false,
155
+ currentRoute: "home",
156
+ data: {},
157
+ }));
158
+ });
159
+
121
160
  beforeEach(() => {
122
161
  jest.clearAllMocks();
123
162
 
@@ -132,6 +171,7 @@ describe("Layout", () => {
132
171
 
133
172
  it("should match snapshot when appReady is true", () => {
134
173
  const { toJSON } = renderWithProviders(<Layout />);
174
+
135
175
  expect(toJSON()).toMatchSnapshot();
136
176
  });
137
177
 
@@ -147,8 +187,8 @@ describe("Layout", () => {
147
187
  });
148
188
 
149
189
  it("should render menu when showMenu is true", () => {
150
- const { getByTestId } = renderWithProviders(<Layout />);
151
- expect(getByTestId("menu")).toBeTruthy();
190
+ const { queryByTestId } = renderWithProviders(<Layout />);
191
+ expect(queryByTestId("menu")).toBeTruthy();
152
192
  });
153
193
 
154
194
  it("should render VideoModal when visible & VideoModal is true", () => {
@@ -180,9 +220,9 @@ describe("Layout", () => {
180
220
 
181
221
  const { getByTestId } = renderWithProviders(<Layout />);
182
222
 
183
- expect(getByTestId("transitioner").props.contentStyle.paddingBottom).toBe(
184
- 50
185
- );
223
+ return expect(
224
+ getByTestId("transitioner").props.contentStyle.paddingBottom
225
+ ).toBe(50);
186
226
  });
187
227
 
188
228
  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-alpha.9270615060",
3
+ "version": "13.0.0-alpha.9814200105",
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-alpha.9270615060",
32
- "@applicaster/zapp-react-native-bridge": "13.0.0-alpha.9270615060",
33
- "@applicaster/zapp-react-native-redux": "13.0.0-alpha.9270615060",
34
- "@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.9270615060",
35
- "@applicaster/zapp-react-native-utils": "13.0.0-alpha.9270615060",
31
+ "@applicaster/quick-brick-core": "13.0.0-alpha.9814200105",
32
+ "@applicaster/zapp-react-native-bridge": "13.0.0-alpha.9814200105",
33
+ "@applicaster/zapp-react-native-redux": "13.0.0-alpha.9814200105",
34
+ "@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.9814200105",
35
+ "@applicaster/zapp-react-native-utils": "13.0.0-alpha.9814200105",
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",