@applicaster/zapp-react-native-utils 12.0.0-rc.4 → 12.0.0-rc.41
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/actionsExecutor/ActionExecutorContext.tsx +16 -8
- package/analyticsUtils/__tests__/analyticsManager.test.js +75 -73
- package/analyticsUtils/helpers/hooks.ts +1 -1
- package/appUtils/HooksManager/index.js +3 -1
- package/appUtils/focusManager/treeDataStructure/Utils/index.js +12 -3
- package/appUtils/keyCodes/__tests__/__snapshots__/keyCodes.test.js.snap +1 -1
- package/appUtils/keyCodes/__tests__/keyCodes.test.js +80 -85
- package/appUtils/keyCodes/keys.web.js +1 -0
- package/appUtils/orientationHelper.ts +1 -1
- package/appUtils/playerManager/OverlayObserver/OverlaysObserver.ts +53 -0
- package/appUtils/playerManager/conts.ts +5 -0
- package/appUtils/playerManager/player.ts +46 -4
- package/appUtils/playerManager/playerFactory.ts +15 -1
- package/appUtils/playerManager/playerNative.ts +30 -0
- package/appUtils/playerManager/usePlayerState.tsx +13 -1
- package/appUtils/playerManager/usePlayerTitleSummaryOverlay.tsx +50 -0
- package/cellUtils/__tests__/cellUtils.test.ts +59 -0
- package/cellUtils/__tests__/fixtures.ts +13 -0
- package/cellUtils/index.ts +44 -2
- package/focusManager/index.ts +1 -1
- package/functionUtils/__tests__/__snapshots__/functionUtils.test.js.snap +2 -2
- package/functionUtils/__tests__/functionUtils.test.js +244 -248
- package/localizationUtils/__tests__/localizationUtils.test.ts +17 -13
- package/localizationUtils/index.ts +6 -3
- package/logger/index.ts +1 -1
- package/manifestUtils/defaultManifestConfigurations/player.js +8 -0
- package/manifestUtils/index.js +5 -1
- package/manifestUtils/secondaryImage/index.js +18 -15
- package/modalState/index.ts +57 -0
- package/navigationUtils/index.ts +56 -7
- package/package.json +3 -2
- package/playerUtils/configurationGenerator.ts +8 -0
- package/pluginUtils/index.ts +11 -7
- package/reactHooks/autoscrolling/__tests__/useTrackCurrentAutoScrollingElement.test.ts +2 -0
- package/reactHooks/autoscrolling/__tests__/useTrackedView.test.ts +2 -0
- package/reactHooks/cell-click/__tests__/index.test.js +6 -2
- package/reactHooks/cell-click/index.ts +2 -2
- package/reactHooks/device/index.ts +0 -1
- package/reactHooks/device/useIsTablet.tsx +28 -3
- package/reactHooks/device/useMemoizedIsTablet.ts +1 -1
- package/reactHooks/device/useOrientation.tsx +3 -1
- package/reactHooks/flatList/useLoadNextPageIfNeeded.ts +16 -9
- package/reactHooks/index.ts +2 -0
- package/reactHooks/layout/__tests__/index.test.js +23 -30
- package/reactHooks/layout/index.ts +2 -1
- package/reactHooks/layout/types/index.ts +1 -0
- package/reactHooks/layout/useDimensions/helpers/__tests__/getInitialDimensions.native.test.js +11 -16
- package/reactHooks/layout/useDimensions/helpers/__tests__/getInitialDimensions.test.js +12 -14
- package/reactHooks/layout/useDimensions/useDimensions.ts +8 -5
- package/reactHooks/navigation/__mocks__/index.ts +2 -0
- package/reactHooks/navigation/__mocks__/useNavigation.ts +4 -0
- package/reactHooks/navigation/__tests__/index.test.tsx +234 -78
- package/reactHooks/navigation/index.ts +246 -85
- package/reactHooks/resolvers/__tests__/useCellResolver.test.tsx +3 -1
- package/reactHooks/screen/__mocks__/useScreenContext.ts +3 -1
- package/reactHooks/screen/index.ts +2 -0
- package/reactHooks/screen/useScreenContext.ts +1 -1
- package/reactHooks/screen/useScreenData.ts +1 -1
- package/reactHooks/screen/useTargetScreenData.ts +7 -0
- package/reactHooks/state/useRivers.ts +3 -1
- package/reactHooks/useListenEventBusEvent.ts +1 -4
- package/reactHooks/videoModal/hooks/useVideoModalScreenData.tsx +10 -9
- package/riverComponetsMeasurementProvider/index.tsx +2 -2
- package/screenState/index.ts +8 -0
- package/testUtils/index.tsx +15 -2
- package/reactHooks/device/useIsTablet.android.tsx +0 -14
- package/reactHooks/device/useIsTablet.ios.tsx +0 -7
- package/reactHooks/device/useIsTablet.web.tsx +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
|
|
3
3
|
import * as R from "ramda";
|
|
4
4
|
|
|
@@ -8,6 +8,7 @@ import { isTV } from "../../../reactUtils";
|
|
|
8
8
|
import { Options, UseDimensions } from "../types";
|
|
9
9
|
import { getDeviceInfo } from "../getDeviceInfo";
|
|
10
10
|
import { getInitialDimensions } from "./helpers";
|
|
11
|
+
import { useIsScreenActive } from "../../navigation";
|
|
11
12
|
|
|
12
13
|
function compensateForScaleIfNeeded(context) {
|
|
13
14
|
return function () {
|
|
@@ -32,8 +33,10 @@ const statusBarHeight = StatusBar?.currentHeight;
|
|
|
32
33
|
*/
|
|
33
34
|
export const useDimensions: UseDimensions = (
|
|
34
35
|
context = "window",
|
|
35
|
-
fullDimensions = { fullDimensions: false }
|
|
36
|
+
fullDimensions = { fullDimensions: false, updateForInactiveScreens: true }
|
|
36
37
|
) => {
|
|
38
|
+
const isActive = useIsScreenActive();
|
|
39
|
+
|
|
37
40
|
if (typeof fullDimensions === "boolean") {
|
|
38
41
|
// eslint-disable-next-line no-console
|
|
39
42
|
console.warn(
|
|
@@ -73,7 +76,7 @@ export const useDimensions: UseDimensions = (
|
|
|
73
76
|
|
|
74
77
|
if (newDimensions.width === newDimensions.height) {
|
|
75
78
|
/**
|
|
76
|
-
* Ignoring case
|
|
79
|
+
* Ignoring case occurred on iOS when Dimensions.get sometimes returning
|
|
77
80
|
* wrong `window` sizes
|
|
78
81
|
* when switch background -> foreground state.
|
|
79
82
|
* ( TODO fix when 1:1 aspect ratio will be used )
|
|
@@ -81,7 +84,7 @@ export const useDimensions: UseDimensions = (
|
|
|
81
84
|
|
|
82
85
|
// eslint-disable-next-line no-console
|
|
83
86
|
console.log("change: wrong values - width equal to height, ignoring");
|
|
84
|
-
} else {
|
|
87
|
+
} else if (isActive || options.updateForInactiveScreens) {
|
|
85
88
|
deviceInfo.current = getDeviceInfo(newDimensions);
|
|
86
89
|
setDimensions(newDimensions);
|
|
87
90
|
}
|
|
@@ -92,7 +95,7 @@ export const useDimensions: UseDimensions = (
|
|
|
92
95
|
return () => {
|
|
93
96
|
activeSubscription.remove();
|
|
94
97
|
};
|
|
95
|
-
}, []);
|
|
98
|
+
}, [isActive]);
|
|
96
99
|
|
|
97
100
|
const memoizedDimensions = useMemo(() => {
|
|
98
101
|
return { ...applyOptions(dimensions), statusBarHeight };
|
|
@@ -23,3 +23,5 @@ export const useNavigation = jest.fn(() => ({
|
|
|
23
23
|
export const useNavigationPluginData = jest.fn().mockReturnValue(mockMenu);
|
|
24
24
|
|
|
25
25
|
export const useIsNavBarVisible = jest.fn().mockReturnValue(true);
|
|
26
|
+
|
|
27
|
+
export const useIsScreenActive = jest.fn().mockReturnValue(true);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { PathnameContext } from "@applicaster/zapp-react-native-ui-components/Contexts/PathnameContext";
|
|
3
3
|
import { renderHook } from "@testing-library/react-hooks";
|
|
4
|
-
import { useRoute } from "../
|
|
4
|
+
import { useRoute, isNavBarVisible } from "../";
|
|
5
5
|
import { Provider } from "react-redux";
|
|
6
6
|
import configureMockStore from "redux-mock-store";
|
|
7
7
|
import { NavigationContext } from "@applicaster/zapp-react-native-ui-components/Contexts/NavigationContext";
|
|
8
8
|
import { ZappHookModalContext } from "@applicaster/zapp-react-native-ui-components/Contexts";
|
|
9
|
-
import { ROUTE_TYPES } from "
|
|
9
|
+
import { ROUTE_TYPES } from "@applicaster/zapp-react-native-utils/navigationUtils/routeTypes";
|
|
10
10
|
|
|
11
11
|
const plugins = [];
|
|
12
12
|
|
|
@@ -45,26 +45,24 @@ const videoItem = {
|
|
|
45
45
|
type: { value: "video" },
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
const
|
|
49
|
-
id: "modal-1",
|
|
50
|
-
};
|
|
48
|
+
const mockGetStackForPathname = jest.fn().mockReturnValue(homeStack);
|
|
51
49
|
|
|
52
50
|
const mainStackNavigator = {
|
|
53
|
-
getStackForPathname:
|
|
54
|
-
|
|
51
|
+
getStackForPathname: mockGetStackForPathname,
|
|
52
|
+
getModalState: () => {},
|
|
55
53
|
videoModalState: {},
|
|
54
|
+
canGoBack: jest.fn(),
|
|
56
55
|
};
|
|
57
56
|
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
const _createWrapper = (Wrapper, props) => {
|
|
58
|
+
return function CreatedWrapper({ children }: any) {
|
|
59
|
+
return <Wrapper {...props}>{children}</Wrapper>;
|
|
60
|
+
};
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
const
|
|
63
|
+
const videoModalNavigator = {
|
|
64
64
|
...mainStackNavigator,
|
|
65
|
-
|
|
66
|
-
screen: modalItem,
|
|
67
|
-
},
|
|
65
|
+
videoModalState: { item: videoItem },
|
|
68
66
|
};
|
|
69
67
|
|
|
70
68
|
const hookModalNavigator = {
|
|
@@ -86,7 +84,6 @@ const hookModalContextState = {
|
|
|
86
84
|
resetState: jest.fn(),
|
|
87
85
|
};
|
|
88
86
|
|
|
89
|
-
const modalPathname = `${ROUTE_TYPES.MODAL}/${modalItem.id}`;
|
|
90
87
|
const hooksModalPathname = `${ROUTE_TYPES.HOOKS_MODAL}/${hookModalContextState.state.screenData.payload.id}`;
|
|
91
88
|
const videoModalPathname = `${ROUTE_TYPES.VIDEO_MODAL}/${videoModalNavigator.videoModalState.item.id}`;
|
|
92
89
|
const mockStore = configureMockStore();
|
|
@@ -97,10 +94,16 @@ const store = mockStore({
|
|
|
97
94
|
contentTypes,
|
|
98
95
|
});
|
|
99
96
|
|
|
100
|
-
const mainStackWrapper = ({
|
|
97
|
+
const mainStackWrapper = ({
|
|
98
|
+
children,
|
|
99
|
+
navigator = {},
|
|
100
|
+
pathname = homeStack.route,
|
|
101
|
+
}) => (
|
|
101
102
|
<Provider store={store}>
|
|
102
|
-
<NavigationContext.Provider
|
|
103
|
-
|
|
103
|
+
<NavigationContext.Provider
|
|
104
|
+
value={{ ...mainStackNavigator, ...navigator, currentRoute: pathname }}
|
|
105
|
+
>
|
|
106
|
+
<PathnameContext.Provider value={pathname}>
|
|
104
107
|
{children}
|
|
105
108
|
</PathnameContext.Provider>
|
|
106
109
|
</NavigationContext.Provider>
|
|
@@ -117,16 +120,6 @@ const videoModalWrapper = ({ children }) => (
|
|
|
117
120
|
</Provider>
|
|
118
121
|
);
|
|
119
122
|
|
|
120
|
-
const modalWrapper = ({ children }) => (
|
|
121
|
-
<Provider store={store}>
|
|
122
|
-
<NavigationContext.Provider value={modalNavigator}>
|
|
123
|
-
<PathnameContext.Provider value={modalPathname}>
|
|
124
|
-
{children}
|
|
125
|
-
</PathnameContext.Provider>
|
|
126
|
-
</NavigationContext.Provider>
|
|
127
|
-
</Provider>
|
|
128
|
-
);
|
|
129
|
-
|
|
130
123
|
const hookModalWrapper = ({ children }) => (
|
|
131
124
|
<Provider store={store}>
|
|
132
125
|
<ZappHookModalContext.ReactContext.Provider value={hookModalContextState}>
|
|
@@ -139,88 +132,251 @@ const hookModalWrapper = ({ children }) => (
|
|
|
139
132
|
</Provider>
|
|
140
133
|
);
|
|
141
134
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
135
|
+
jest.mock("../../../modalState", () => ({
|
|
136
|
+
useModalStore: jest.fn(),
|
|
137
|
+
}));
|
|
138
|
+
|
|
139
|
+
describe("navigation", () => {
|
|
140
|
+
describe("useRoute", () => {
|
|
141
|
+
describe("Main stack components", () => {
|
|
142
|
+
it("should return a correct pathname", () => {
|
|
143
|
+
const { result } = renderHook(() => useRoute(), {
|
|
144
|
+
wrapper: mainStackWrapper,
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
expect(result.current.pathname).toEqual(homeStack.route);
|
|
147
148
|
});
|
|
148
149
|
|
|
149
|
-
|
|
150
|
+
it("should return correct screenData information", () => {
|
|
151
|
+
const { result } = renderHook(() => useRoute(), {
|
|
152
|
+
wrapper: mainStackWrapper,
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
expect(result.current.screenData.id).toEqual(entry.id);
|
|
156
|
+
|
|
157
|
+
expect(result.current.screenData.targetScreen.id).toEqual(screen.id);
|
|
158
|
+
});
|
|
150
159
|
});
|
|
151
160
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
161
|
+
describe("Hook modal components", () => {
|
|
162
|
+
it("should return a correct pathname", () => {
|
|
163
|
+
const { result } = renderHook(() => useRoute(), {
|
|
164
|
+
wrapper: hookModalWrapper,
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
expect(result.current.pathname).toEqual(hooksModalPathname);
|
|
155
168
|
});
|
|
156
169
|
|
|
157
|
-
|
|
170
|
+
it("should return correct screenData information", () => {
|
|
171
|
+
const { result } = renderHook(() => useRoute(), {
|
|
172
|
+
wrapper: hookModalWrapper,
|
|
173
|
+
});
|
|
158
174
|
|
|
159
|
-
|
|
175
|
+
expect(result.current.screenData.id).toEqual(
|
|
176
|
+
hookModalContextState.state.screenData.payload.id
|
|
177
|
+
);
|
|
178
|
+
});
|
|
160
179
|
});
|
|
161
|
-
});
|
|
162
180
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
181
|
+
describe("Video modal components", () => {
|
|
182
|
+
it("should return a correct pathname", () => {
|
|
183
|
+
const { result } = renderHook(() => useRoute(), {
|
|
184
|
+
wrapper: videoModalWrapper,
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
expect(result.current.pathname).toEqual(videoModalPathname);
|
|
167
188
|
});
|
|
168
189
|
|
|
169
|
-
|
|
170
|
-
|
|
190
|
+
it("should return correct screenData information", () => {
|
|
191
|
+
const { result } = renderHook(() => useRoute(), {
|
|
192
|
+
wrapper: videoModalWrapper,
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
expect(result.current.screenData.id).toEqual(
|
|
196
|
+
videoModalNavigator.videoModalState.item.id
|
|
197
|
+
);
|
|
171
198
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
199
|
+
expect(result.current.screenData.targetScreen.id).toEqual(
|
|
200
|
+
rivers["river-player"].id
|
|
201
|
+
);
|
|
175
202
|
});
|
|
203
|
+
});
|
|
204
|
+
});
|
|
176
205
|
|
|
177
|
-
|
|
178
|
-
|
|
206
|
+
describe("isNavBarVisible", () => {
|
|
207
|
+
it("returns false when the route is a player route", () => {
|
|
208
|
+
const navBarVisible = isNavBarVisible(
|
|
209
|
+
"/playable/some_vod_item",
|
|
210
|
+
{} as ZappRiver,
|
|
211
|
+
false,
|
|
212
|
+
false
|
|
179
213
|
);
|
|
214
|
+
|
|
215
|
+
expect(navBarVisible).toBe(false);
|
|
180
216
|
});
|
|
181
|
-
});
|
|
182
217
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
218
|
+
it("returns false when the next screen is the QB search screen", () => {
|
|
219
|
+
const navBarVisible = isNavBarVisible(
|
|
220
|
+
"/river/A1234",
|
|
221
|
+
{
|
|
222
|
+
type: "qb_search_screen",
|
|
223
|
+
} as any,
|
|
224
|
+
false,
|
|
225
|
+
false
|
|
226
|
+
);
|
|
188
227
|
|
|
189
|
-
expect(
|
|
228
|
+
expect(navBarVisible).toBe(false);
|
|
190
229
|
});
|
|
191
230
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
231
|
+
describe("when screen is a hook", () => {
|
|
232
|
+
it("returns true if the `showNavBar` flag is set to true", () => {
|
|
233
|
+
const navBarVisible = isNavBarVisible(
|
|
234
|
+
"",
|
|
235
|
+
{
|
|
236
|
+
hookPlugin: {
|
|
237
|
+
module: {
|
|
238
|
+
showNavBar: true,
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
} as any,
|
|
242
|
+
false,
|
|
243
|
+
false
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
expect(navBarVisible).toBe(true);
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
it("returns true if presentFullScreen flag is set to false", () => {
|
|
250
|
+
const navBarVisible = isNavBarVisible(
|
|
251
|
+
"",
|
|
252
|
+
{
|
|
253
|
+
hookPlugin: {
|
|
254
|
+
module: {
|
|
255
|
+
presentFullScreen: false,
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
} as any,
|
|
259
|
+
false,
|
|
260
|
+
false
|
|
261
|
+
);
|
|
262
|
+
|
|
263
|
+
expect(navBarVisible).toBe(true);
|
|
195
264
|
});
|
|
196
265
|
|
|
197
|
-
|
|
198
|
-
|
|
266
|
+
it("returns false if presentFullScreen flag is set to true", () => {
|
|
267
|
+
const navBarVisible = isNavBarVisible(
|
|
268
|
+
"",
|
|
269
|
+
{
|
|
270
|
+
hookPlugin: {
|
|
271
|
+
module: {
|
|
272
|
+
presentFullScreen: true,
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
} as any,
|
|
276
|
+
false,
|
|
277
|
+
false
|
|
278
|
+
);
|
|
279
|
+
|
|
280
|
+
expect(navBarVisible).toBe(false);
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
it("returns false if the screen's general settings allow screen presentation", () => {
|
|
285
|
+
const navBarVisible = isNavBarVisible(
|
|
286
|
+
"",
|
|
287
|
+
{
|
|
288
|
+
general: {
|
|
289
|
+
allow_screen_plugin_presentation: true,
|
|
290
|
+
},
|
|
291
|
+
} as any,
|
|
292
|
+
false,
|
|
293
|
+
false
|
|
199
294
|
);
|
|
200
295
|
|
|
201
|
-
expect(
|
|
202
|
-
|
|
296
|
+
expect(navBarVisible).toBe(false);
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
it("returns false if the screen's general settings hide app nav bar", () => {
|
|
300
|
+
const navBarVisible = isNavBarVisible(
|
|
301
|
+
"",
|
|
302
|
+
{
|
|
303
|
+
general: {
|
|
304
|
+
hide_app_nav_bar: true,
|
|
305
|
+
},
|
|
306
|
+
} as any,
|
|
307
|
+
false,
|
|
308
|
+
false
|
|
203
309
|
);
|
|
310
|
+
|
|
311
|
+
expect(navBarVisible).toBe(false);
|
|
204
312
|
});
|
|
205
|
-
});
|
|
206
313
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
314
|
+
it("returns false if it's secondary nav bar and hide_secondary_level_menu is true", () => {
|
|
315
|
+
const navBarVisible = isNavBarVisible(
|
|
316
|
+
"",
|
|
317
|
+
{
|
|
318
|
+
navigations: [
|
|
319
|
+
{
|
|
320
|
+
styles: {
|
|
321
|
+
hide_secondary_level_menu: true,
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
],
|
|
325
|
+
} as any,
|
|
326
|
+
false,
|
|
327
|
+
true
|
|
328
|
+
);
|
|
212
329
|
|
|
213
|
-
expect(
|
|
330
|
+
expect(navBarVisible).toBe(false);
|
|
214
331
|
});
|
|
215
332
|
|
|
216
|
-
it("
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
|
|
333
|
+
it("returns true if it's secondary nav bar and hide_secondary_level_menu is false", () => {
|
|
334
|
+
const navBarVisible = isNavBarVisible(
|
|
335
|
+
"",
|
|
336
|
+
{
|
|
337
|
+
navigations: [
|
|
338
|
+
{
|
|
339
|
+
styles: {
|
|
340
|
+
hide_secondary_level_menu: false,
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
],
|
|
344
|
+
} as any,
|
|
345
|
+
true,
|
|
346
|
+
false
|
|
347
|
+
);
|
|
348
|
+
|
|
349
|
+
expect(navBarVisible).toBe(true);
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
it("returns true if it's first level menu and hide_secondary_level_menu is true", () => {
|
|
353
|
+
const navBarVisible = isNavBarVisible(
|
|
354
|
+
"",
|
|
355
|
+
{
|
|
356
|
+
navigations: [
|
|
357
|
+
{
|
|
358
|
+
styles: {
|
|
359
|
+
hide_secondary_level_menu: true,
|
|
360
|
+
},
|
|
361
|
+
},
|
|
362
|
+
],
|
|
363
|
+
} as any,
|
|
364
|
+
true,
|
|
365
|
+
false
|
|
366
|
+
);
|
|
220
367
|
|
|
221
|
-
expect(
|
|
222
|
-
|
|
368
|
+
expect(navBarVisible).toBe(true);
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
it("returns true otherwise", () => {
|
|
372
|
+
const navBarVisible = isNavBarVisible(
|
|
373
|
+
"",
|
|
374
|
+
{ navigations: [] } as any,
|
|
375
|
+
true,
|
|
376
|
+
true
|
|
223
377
|
);
|
|
378
|
+
|
|
379
|
+
expect(navBarVisible).toBe(true);
|
|
224
380
|
});
|
|
225
381
|
});
|
|
226
382
|
});
|