@applicaster/zapp-react-native-utils 12.0.0-alpha.7725319213 → 12.0.0-alpha.7843515010
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/AnalyticPlayerListener.ts +141 -0
- package/analyticsUtils/AnalyticsEvents/index.ts +13 -0
- package/analyticsUtils/AnalyticsEvents/searchEvents.ts +21 -0
- package/analyticsUtils/AnalyticsEvents/sendShareEvent.ts +21 -0
- package/analyticsUtils/PlayerAnalyticsManager.ts +90 -0
- package/analyticsUtils/__tests__/analyticsManager.test.js +75 -73
- package/analyticsUtils/analyticsPlugins.ts +25 -0
- package/analyticsUtils/events.ts +12 -0
- package/analyticsUtils/helpers/hooks.ts +1 -1
- package/analyticsUtils/index.tsx +12 -0
- package/analyticsUtils/{analyticsTracker.ts → playerAnalyticsTracker.ts} +19 -10
- package/appUtils/HooksManager/index.js +3 -1
- package/appUtils/accessibilityManager/const.ts +50 -0
- package/appUtils/accessibilityManager/hooks.ts +40 -0
- package/appUtils/accessibilityManager/index.ts +166 -0
- package/appUtils/accessibilityManager/logger.ts +5 -0
- package/appUtils/focusManager/__tests__/__snapshots__/focusManager.test.js.snap +2 -3
- package/appUtils/focusManager/__tests__/focusManager.test.js +4 -24
- package/appUtils/focusManager/__tests__/index.test.ts +2 -3
- package/appUtils/focusManager/index.ts +76 -57
- package/appUtils/focusManager/treeDataStructure/Utils/index.js +75 -35
- package/appUtils/focusManager/utils/index.ts +100 -0
- package/appUtils/focusManagerAux/index.ts +76 -0
- package/appUtils/focusManagerAux/utils/index.ts +100 -0
- package/appUtils/index.js +2 -0
- 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 +9 -0
- package/appUtils/keyCodes/keysByPlatform.js +11 -1
- package/appUtils/platform/const.ts +25 -0
- package/appUtils/platform/index.ts +3 -0
- package/appUtils/platform/platformUtils.ts +185 -0
- package/appUtils/playerManager/OverlayObserver/OverlaysObserver.ts +53 -0
- package/appUtils/playerManager/conts.ts +6 -0
- package/appUtils/playerManager/index.ts +20 -32
- package/appUtils/playerManager/nativePlayerManager.ts +12 -0
- package/appUtils/playerManager/player.ts +56 -9
- package/appUtils/playerManager/playerFactory.ts +12 -10
- package/appUtils/playerManager/playerNative.ts +37 -15
- package/appUtils/playerManager/usePlayerControllerSetup.tsx +7 -1
- package/appUtils/playerManager/usePlayerState.tsx +13 -1
- package/appUtils/playerManager/usePlayerTitleSummaryOverlay.tsx +50 -0
- package/arrayUtils/__tests__/isFilledArray.test.ts +63 -0
- package/arrayUtils/index.ts +5 -0
- package/booleanUtils/index.ts +4 -4
- package/cellUtils/__tests__/cellUtils.test.ts +48 -0
- package/cellUtils/__tests__/fixtures.ts +13 -0
- package/cellUtils/index.ts +65 -7
- package/dateUtils/index.ts +11 -0
- 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/headersUtils/index.ts +1 -0
- package/index.d.ts +15 -0
- package/inflatedUrlUtils/index.ts +4 -4
- package/keyboardState/index.ts +0 -0
- package/localizationUtils/__tests__/localizationUtils.test.ts +78 -55
- package/localizationUtils/index.ts +13 -19
- package/logger/index.ts +1 -1
- package/manifestUtils/defaultManifestConfigurations/generalContent.js +6 -0
- package/manifestUtils/defaultManifestConfigurations/player.js +10 -1
- package/manifestUtils/index.js +5 -1
- package/manifestUtils/secondaryImage/index.js +18 -15
- package/modalState/index.ts +57 -0
- package/navigationUtils/index.ts +104 -7
- package/numberUtils/__tests__/isLikeNumber.test.ts +18 -0
- package/numberUtils/__tests__/toNumber.test.ts +2 -2
- package/numberUtils/index.ts +9 -18
- package/package.json +3 -2
- package/playerUtils/configurationGenerator.ts +11 -1
- package/playerUtils/imaScriptDom.ts +59 -0
- package/pluginUtils/index.ts +11 -2
- package/reactHooks/autoscrolling/__tests__/useTrackCurrentAutoScrollingElement.test.ts +2 -0
- package/reactHooks/autoscrolling/__tests__/{useTrackedView.test.ts → useTrackedView.test.tsx} +18 -1
- package/reactHooks/cell-click/__tests__/index.test.js +10 -1
- package/reactHooks/cell-click/index.ts +12 -12
- package/reactHooks/debugging/__tests__/index.test.js +81 -11
- package/reactHooks/feed/__tests__/useBuildPipesUrl.test.tsx +30 -70
- package/reactHooks/feed/__tests__/useFeedRefresh.test.tsx +6 -2
- package/reactHooks/feed/__tests__/useInflatedUrl.test.ts +18 -3
- package/reactHooks/feed/useBuildPipesUrl.ts +7 -10
- package/reactHooks/feed/useFeedRefresh.tsx +9 -7
- package/reactHooks/feed/useInflatedUrl.ts +44 -15
- package/reactHooks/flatList/useLoadNextPageIfNeeded.ts +16 -9
- package/reactHooks/index.ts +2 -0
- package/reactHooks/layout/__tests__/{index.test.js → index.test.tsx} +66 -59
- package/reactHooks/layout/getDeviceInfo/index.ts +4 -2
- package/reactHooks/layout/types/index.ts +2 -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 +13 -7
- package/reactHooks/navigation/__mocks__/index.ts +15 -0
- package/reactHooks/navigation/__mocks__/useNavigation.ts +7 -0
- package/reactHooks/navigation/__tests__/index.test.tsx +240 -81
- package/reactHooks/navigation/index.ts +239 -80
- package/reactHooks/resolvers/__tests__/useCellResolver.test.tsx +3 -1
- package/reactHooks/resolvers/useCellResolver.ts +5 -1
- package/reactHooks/screen/__mocks__/useScreenContext.ts +3 -1
- package/reactHooks/screen/__tests__/useCurrentScreenData.test.tsx +21 -23
- package/reactHooks/screen/index.ts +4 -0
- package/reactHooks/screen/useScreenBackgroundColor.ts +23 -0
- package/reactHooks/screen/useScreenContext.ts +4 -4
- package/reactHooks/screen/useScreenData.ts +1 -1
- package/reactHooks/state/useRivers.ts +3 -1
- package/reactHooks/useListenEventBusEvent.ts +1 -4
- package/reactHooks/videoModal/hooks/useVideoModalScreenData.tsx +10 -9
- package/reactUtils/index.ts +104 -0
- package/riverComponetsMeasurementProvider/index.tsx +2 -2
- package/stringUtils/index.ts +5 -0
- package/testUtils/getByTestId.ts +14 -0
- package/testUtils/index.tsx +38 -23
- package/types.ts +4 -0
- package/appUtils/focusManager/FocusableEvents.ts +0 -8
- package/appUtils/focusManager/treeDataStructure/Utils/__tests__/Utils_android.test.js +0 -1094
- package/appUtils/focusManager/treeDataStructure/Utils/index.android.js +0 -261
|
@@ -1,12 +1,13 @@
|
|
|
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 { isNavBarVisible, useRoute } 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
|
+
import { ScreenDataContext } from "@applicaster/zapp-react-native-ui-components/Contexts/ScreenDataContext";
|
|
10
11
|
|
|
11
12
|
const plugins = [];
|
|
12
13
|
|
|
@@ -45,26 +46,24 @@ const videoItem = {
|
|
|
45
46
|
type: { value: "video" },
|
|
46
47
|
};
|
|
47
48
|
|
|
48
|
-
const
|
|
49
|
-
id: "modal-1",
|
|
50
|
-
};
|
|
49
|
+
const mockGetStackForPathname = jest.fn().mockReturnValue(homeStack);
|
|
51
50
|
|
|
52
51
|
const mainStackNavigator = {
|
|
53
|
-
getStackForPathname:
|
|
54
|
-
|
|
52
|
+
getStackForPathname: mockGetStackForPathname,
|
|
53
|
+
getModalState: () => {},
|
|
55
54
|
videoModalState: {},
|
|
55
|
+
canGoBack: jest.fn(),
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
const _createWrapper = (Wrapper, props) => {
|
|
59
|
+
return function CreatedWrapper({ children }: any) {
|
|
60
|
+
return <Wrapper {...props}>{children}</Wrapper>;
|
|
61
|
+
};
|
|
61
62
|
};
|
|
62
63
|
|
|
63
|
-
const
|
|
64
|
+
const videoModalNavigator = {
|
|
64
65
|
...mainStackNavigator,
|
|
65
|
-
|
|
66
|
-
screen: modalItem,
|
|
67
|
-
},
|
|
66
|
+
videoModalState: { item: videoItem },
|
|
68
67
|
};
|
|
69
68
|
|
|
70
69
|
const hookModalNavigator = {
|
|
@@ -86,7 +85,6 @@ const hookModalContextState = {
|
|
|
86
85
|
resetState: jest.fn(),
|
|
87
86
|
};
|
|
88
87
|
|
|
89
|
-
const modalPathname = `${ROUTE_TYPES.MODAL}/${modalItem.id}`;
|
|
90
88
|
const hooksModalPathname = `${ROUTE_TYPES.HOOKS_MODAL}/${hookModalContextState.state.screenData.payload.id}`;
|
|
91
89
|
const videoModalPathname = `${ROUTE_TYPES.VIDEO_MODAL}/${videoModalNavigator.videoModalState.item.id}`;
|
|
92
90
|
const mockStore = configureMockStore();
|
|
@@ -97,13 +95,21 @@ const store = mockStore({
|
|
|
97
95
|
contentTypes,
|
|
98
96
|
});
|
|
99
97
|
|
|
100
|
-
const mainStackWrapper = ({
|
|
98
|
+
const mainStackWrapper = ({
|
|
99
|
+
children,
|
|
100
|
+
navigator = {},
|
|
101
|
+
pathname = homeStack.route,
|
|
102
|
+
}) => (
|
|
101
103
|
<Provider store={store}>
|
|
102
|
-
<
|
|
103
|
-
<
|
|
104
|
-
{
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
<ScreenDataContext.Provider value={homeStack.state}>
|
|
105
|
+
<NavigationContext.Provider
|
|
106
|
+
value={{ ...mainStackNavigator, ...navigator, currentRoute: pathname }}
|
|
107
|
+
>
|
|
108
|
+
<PathnameContext.Provider value={pathname}>
|
|
109
|
+
{children}
|
|
110
|
+
</PathnameContext.Provider>
|
|
111
|
+
</NavigationContext.Provider>
|
|
112
|
+
</ScreenDataContext.Provider>
|
|
107
113
|
</Provider>
|
|
108
114
|
);
|
|
109
115
|
|
|
@@ -117,16 +123,6 @@ const videoModalWrapper = ({ children }) => (
|
|
|
117
123
|
</Provider>
|
|
118
124
|
);
|
|
119
125
|
|
|
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
126
|
const hookModalWrapper = ({ children }) => (
|
|
131
127
|
<Provider store={store}>
|
|
132
128
|
<ZappHookModalContext.ReactContext.Provider value={hookModalContextState}>
|
|
@@ -139,88 +135,251 @@ const hookModalWrapper = ({ children }) => (
|
|
|
139
135
|
</Provider>
|
|
140
136
|
);
|
|
141
137
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
138
|
+
jest.mock("../../../modalState", () => ({
|
|
139
|
+
useModalStore: jest.fn(),
|
|
140
|
+
}));
|
|
141
|
+
|
|
142
|
+
describe("navigation", () => {
|
|
143
|
+
describe("useRoute", () => {
|
|
144
|
+
describe("Main stack components", () => {
|
|
145
|
+
it("should return a correct pathname", () => {
|
|
146
|
+
const { result } = renderHook(() => useRoute(), {
|
|
147
|
+
wrapper: mainStackWrapper,
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
expect(result.current.pathname).toEqual(homeStack.route);
|
|
147
151
|
});
|
|
148
152
|
|
|
149
|
-
|
|
153
|
+
it("should return correct screenData information", () => {
|
|
154
|
+
const { result } = renderHook(() => useRoute(), {
|
|
155
|
+
wrapper: mainStackWrapper,
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
expect(result.current.screenData.id).toEqual(entry.id);
|
|
159
|
+
|
|
160
|
+
expect(result.current.screenData.targetScreen.id).toEqual(screen.id);
|
|
161
|
+
});
|
|
150
162
|
});
|
|
151
163
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
164
|
+
describe("Hook modal components", () => {
|
|
165
|
+
it("should return a correct pathname", () => {
|
|
166
|
+
const { result } = renderHook(() => useRoute(), {
|
|
167
|
+
wrapper: hookModalWrapper,
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
expect(result.current.pathname).toEqual(hooksModalPathname);
|
|
155
171
|
});
|
|
156
172
|
|
|
157
|
-
|
|
173
|
+
it("should return correct screenData information", () => {
|
|
174
|
+
const { result } = renderHook(() => useRoute(), {
|
|
175
|
+
wrapper: hookModalWrapper,
|
|
176
|
+
});
|
|
158
177
|
|
|
159
|
-
|
|
178
|
+
expect(result.current.screenData.id).toEqual(
|
|
179
|
+
hookModalContextState.state.screenData.payload.id
|
|
180
|
+
);
|
|
181
|
+
});
|
|
160
182
|
});
|
|
161
|
-
});
|
|
162
183
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
184
|
+
describe("Video modal components", () => {
|
|
185
|
+
it("should return a correct pathname", () => {
|
|
186
|
+
const { result } = renderHook(() => useRoute(), {
|
|
187
|
+
wrapper: videoModalWrapper,
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
expect(result.current.pathname).toEqual(videoModalPathname);
|
|
167
191
|
});
|
|
168
192
|
|
|
169
|
-
|
|
170
|
-
|
|
193
|
+
it("should return correct screenData information", () => {
|
|
194
|
+
const { result } = renderHook(() => useRoute(), {
|
|
195
|
+
wrapper: videoModalWrapper,
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
expect(result.current.screenData.id).toEqual(
|
|
199
|
+
videoModalNavigator.videoModalState.item.id
|
|
200
|
+
);
|
|
171
201
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
202
|
+
expect(result.current.screenData.targetScreen.id).toEqual(
|
|
203
|
+
rivers["river-player"].id
|
|
204
|
+
);
|
|
175
205
|
});
|
|
206
|
+
});
|
|
207
|
+
});
|
|
176
208
|
|
|
177
|
-
|
|
178
|
-
|
|
209
|
+
describe("isNavBarVisible", () => {
|
|
210
|
+
it("returns false when the route is a player route", () => {
|
|
211
|
+
const navBarVisible = isNavBarVisible(
|
|
212
|
+
"/playable/some_vod_item",
|
|
213
|
+
{} as ZappRiver,
|
|
214
|
+
false,
|
|
215
|
+
false
|
|
179
216
|
);
|
|
217
|
+
|
|
218
|
+
expect(navBarVisible).toBe(false);
|
|
180
219
|
});
|
|
181
|
-
});
|
|
182
220
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
221
|
+
it("returns false when the next screen is the QB search screen", () => {
|
|
222
|
+
const navBarVisible = isNavBarVisible(
|
|
223
|
+
"/river/A1234",
|
|
224
|
+
{
|
|
225
|
+
type: "qb_search_screen",
|
|
226
|
+
} as any,
|
|
227
|
+
false,
|
|
228
|
+
false
|
|
229
|
+
);
|
|
188
230
|
|
|
189
|
-
expect(
|
|
231
|
+
expect(navBarVisible).toBe(false);
|
|
190
232
|
});
|
|
191
233
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
234
|
+
describe("when screen is a hook", () => {
|
|
235
|
+
it("returns true if the `showNavBar` flag is set to true", () => {
|
|
236
|
+
const navBarVisible = isNavBarVisible(
|
|
237
|
+
"",
|
|
238
|
+
{
|
|
239
|
+
hookPlugin: {
|
|
240
|
+
module: {
|
|
241
|
+
showNavBar: true,
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
} as any,
|
|
245
|
+
false,
|
|
246
|
+
false
|
|
247
|
+
);
|
|
248
|
+
|
|
249
|
+
expect(navBarVisible).toBe(true);
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
it("returns true if presentFullScreen flag is set to false", () => {
|
|
253
|
+
const navBarVisible = isNavBarVisible(
|
|
254
|
+
"",
|
|
255
|
+
{
|
|
256
|
+
hookPlugin: {
|
|
257
|
+
module: {
|
|
258
|
+
presentFullScreen: false,
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
} as any,
|
|
262
|
+
false,
|
|
263
|
+
false
|
|
264
|
+
);
|
|
265
|
+
|
|
266
|
+
expect(navBarVisible).toBe(true);
|
|
195
267
|
});
|
|
196
268
|
|
|
197
|
-
|
|
198
|
-
|
|
269
|
+
it("returns false if presentFullScreen flag is set to true", () => {
|
|
270
|
+
const navBarVisible = isNavBarVisible(
|
|
271
|
+
"",
|
|
272
|
+
{
|
|
273
|
+
hookPlugin: {
|
|
274
|
+
module: {
|
|
275
|
+
presentFullScreen: true,
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
} as any,
|
|
279
|
+
false,
|
|
280
|
+
false
|
|
281
|
+
);
|
|
282
|
+
|
|
283
|
+
expect(navBarVisible).toBe(false);
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
it("returns false if the screen's general settings allow screen presentation", () => {
|
|
288
|
+
const navBarVisible = isNavBarVisible(
|
|
289
|
+
"",
|
|
290
|
+
{
|
|
291
|
+
general: {
|
|
292
|
+
allow_screen_plugin_presentation: true,
|
|
293
|
+
},
|
|
294
|
+
} as any,
|
|
295
|
+
false,
|
|
296
|
+
false
|
|
297
|
+
);
|
|
298
|
+
|
|
299
|
+
expect(navBarVisible).toBe(false);
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
it("returns false if the screen's general settings hide app nav bar", () => {
|
|
303
|
+
const navBarVisible = isNavBarVisible(
|
|
304
|
+
"",
|
|
305
|
+
{
|
|
306
|
+
general: {
|
|
307
|
+
hide_app_nav_bar: true,
|
|
308
|
+
},
|
|
309
|
+
} as any,
|
|
310
|
+
false,
|
|
311
|
+
false
|
|
199
312
|
);
|
|
200
313
|
|
|
201
|
-
expect(
|
|
202
|
-
|
|
314
|
+
expect(navBarVisible).toBe(false);
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
it("returns false if it's secondary nav bar and hide_secondary_level_menu is true", () => {
|
|
318
|
+
const navBarVisible = isNavBarVisible(
|
|
319
|
+
"",
|
|
320
|
+
{
|
|
321
|
+
navigations: [
|
|
322
|
+
{
|
|
323
|
+
styles: {
|
|
324
|
+
hide_secondary_level_menu: true,
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
],
|
|
328
|
+
} as any,
|
|
329
|
+
false,
|
|
330
|
+
true
|
|
203
331
|
);
|
|
332
|
+
|
|
333
|
+
expect(navBarVisible).toBe(false);
|
|
204
334
|
});
|
|
205
|
-
});
|
|
206
335
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
336
|
+
it("returns true if it's secondary nav bar and hide_secondary_level_menu is false", () => {
|
|
337
|
+
const navBarVisible = isNavBarVisible(
|
|
338
|
+
"",
|
|
339
|
+
{
|
|
340
|
+
navigations: [
|
|
341
|
+
{
|
|
342
|
+
styles: {
|
|
343
|
+
hide_secondary_level_menu: false,
|
|
344
|
+
},
|
|
345
|
+
},
|
|
346
|
+
],
|
|
347
|
+
} as any,
|
|
348
|
+
true,
|
|
349
|
+
false
|
|
350
|
+
);
|
|
212
351
|
|
|
213
|
-
expect(
|
|
352
|
+
expect(navBarVisible).toBe(true);
|
|
214
353
|
});
|
|
215
354
|
|
|
216
|
-
it("
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
|
|
355
|
+
it("returns true if it's first level menu and hide_secondary_level_menu is true", () => {
|
|
356
|
+
const navBarVisible = isNavBarVisible(
|
|
357
|
+
"",
|
|
358
|
+
{
|
|
359
|
+
navigations: [
|
|
360
|
+
{
|
|
361
|
+
styles: {
|
|
362
|
+
hide_secondary_level_menu: true,
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
],
|
|
366
|
+
} as any,
|
|
367
|
+
true,
|
|
368
|
+
false
|
|
369
|
+
);
|
|
220
370
|
|
|
221
|
-
expect(
|
|
222
|
-
|
|
371
|
+
expect(navBarVisible).toBe(true);
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
it("returns true otherwise", () => {
|
|
375
|
+
const navBarVisible = isNavBarVisible(
|
|
376
|
+
"",
|
|
377
|
+
{ navigations: [] } as any,
|
|
378
|
+
true,
|
|
379
|
+
true
|
|
223
380
|
);
|
|
381
|
+
|
|
382
|
+
expect(navBarVisible).toBe(true);
|
|
224
383
|
});
|
|
225
384
|
});
|
|
226
385
|
});
|