@applicaster/quick-brick-core 12.0.0-alpha.3977160850 → 12.0.0-alpha.4374801485

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.
@@ -91,9 +91,7 @@ const getActionInitialStateSetters = (key) => {
91
91
  const now = performance.now();
92
92
 
93
93
  logger.info({
94
- message: `Invocation Started - action plugin ${key}, pluginId: ${
95
- subscription.pluginId
96
- }`,
94
+ message: `Invocation Started - action plugin ${key}, pluginId: ${subscription.pluginId}`,
97
95
  });
98
96
 
99
97
  const promiseFunc = subscription[key];
@@ -323,7 +323,7 @@ describe("asset cache", () => {
323
323
 
324
324
  expect(saveCacheData).toHaveBeenCalledWith(
325
325
  layoutId,
326
- newFiles.filter(({ url }) => !url.includes("fail")),
326
+ newFiles.filter(({ url }) => !url.includes("fail"))
327
327
  );
328
328
  });
329
329
 
@@ -143,7 +143,12 @@ export async function cacheAssets({
143
143
 
144
144
  newCacheState.forEach(({ file, url }) => (urlFileMap[url] = file));
145
145
 
146
- const updatedLayout = remapAssetPath(layoutAssets, layout, urlFileMap, "layoutAssets");
146
+ const updatedLayout = remapAssetPath(
147
+ layoutAssets,
148
+ layout,
149
+ urlFileMap,
150
+ "layoutAssets"
151
+ );
147
152
 
148
153
  const updatedPluginConfigurations = remapAssetPath(
149
154
  pluginAssets,
@@ -169,6 +174,8 @@ export async function cacheAssets({
169
174
 
170
175
  return { layout, pluginConfigurations, cellStyles };
171
176
  } finally {
172
- log_verbose(`cacheAssets: caching assets took ${performance.now() - time} ms`);
177
+ log_verbose(
178
+ `cacheAssets: caching assets took ${performance.now() - time} ms`
179
+ );
173
180
  }
174
181
  }
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { render, waitFor, cleanup } from "@testing-library/react-native";
2
+ import { cleanup, render, waitFor } from "@testing-library/react-native";
3
3
 
4
4
  const theme = {
5
5
  screen_margin_top: 0,
@@ -8,6 +8,8 @@ const theme = {
8
8
 
9
9
  const plugins = [];
10
10
 
11
+ jest.mock("@applicaster/zapp-react-native-utils/reactHooks/navigation");
12
+
11
13
  jest.mock("@applicaster/zapp-react-native-utils/theme", () => ({
12
14
  useTheme: jest.fn(() => theme),
13
15
  }));
@@ -167,7 +167,7 @@ export function NavigationProvider({ children }: Props) {
167
167
  [rivers, homeRiver]
168
168
  );
169
169
 
170
- const getStack = () => [...stateRef?.current?.stack?.mainStack];
170
+ const getStack = () => [...state?.stack?.mainStack];
171
171
 
172
172
  const openVideoModal = (
173
173
  item: ZappEntry,
@@ -668,7 +668,7 @@ export function NavigationProvider({ children }: Props) {
668
668
  const getStackForPathname = React.useCallback((pathname: string):
669
669
  | NavigationScreenState
670
670
  | undefined => {
671
- const stack = getStack();
671
+ const stack = [...stateRef?.current?.stack?.mainStack];
672
672
 
673
673
  const currentStack = stack.find(({ route }) => route === pathname);
674
674
 
@@ -1,13 +1,20 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`<RouteManager /> renders correctly 1`] = `
4
- <WithProvider
5
- screenData={
6
- Object {
7
- "id": "A1234",
8
- }
4
+ <RNCSafeAreaProvider
5
+ onInsetsChange={[Function]}
6
+ style={
7
+ Array [
8
+ Object {
9
+ "flex": 1,
10
+ },
11
+ undefined,
12
+ ]
9
13
  }
10
- screenId="A1234"
11
- screenType="river"
12
- />
14
+ >
15
+ <View
16
+ comp="river"
17
+ testID="river"
18
+ />
19
+ </RNCSafeAreaProvider>
13
20
  `;
@@ -1,31 +1,42 @@
1
1
  import React from "react";
2
- import { shallow } from "enzyme";
3
- import { shallowToJson } from "enzyme-to-json";
4
2
 
5
- import { ScreenResolver } from "@applicaster/zapp-react-native-ui-components/Components/ScreenResolver";
3
+ const {
4
+ ScreenResolver,
5
+ } = require("@applicaster/zapp-react-native-ui-components/Components/ScreenResolver");
6
+
7
+ import { renderWithProviders } from "@applicaster/zapp-react-native-utils/testUtils";
6
8
 
7
9
  jest.mock("@applicaster/zapp-react-native-utils/reactHooks/navigation", () => ({
8
10
  useNavigation: jest.fn(() => ({
9
11
  screenId: { id: "A1234" },
10
12
  currentRoute: "/river/A1234",
11
13
  screenData: { id: "A1234" },
14
+ videoModalState: { mode: "WINDOWED" },
15
+ })),
16
+ useRoute: jest.fn(() => ({
17
+ pathname: "/river/A1234",
18
+ screenData: { id: "A1234-screenData" },
12
19
  })),
13
20
  }));
14
21
 
15
22
  const { RouteManager } = require("../");
16
23
 
17
24
  describe("<RouteManager />", () => {
18
- const wrapper = shallow(<RouteManager />);
25
+ let wrapper;
26
+
27
+ beforeEach(() => {
28
+ wrapper = renderWithProviders(<RouteManager />);
29
+ });
19
30
 
20
31
  it("renders correctly", () => {
21
- expect(shallowToJson(wrapper)).toMatchSnapshot();
32
+ expect(wrapper.toJSON()).toMatchSnapshot();
22
33
  });
23
34
 
24
35
  it("passes the correct props to ScreenResolver", () => {
25
- expect(wrapper.find(ScreenResolver).props()).toEqual({
36
+ expect(wrapper.UNSAFE_getByType(ScreenResolver).props).toEqual({
26
37
  screenType: "river",
27
38
  screenId: "A1234",
28
- screenData: { id: "A1234" },
39
+ screenData: { id: "A1234-screenData" },
29
40
  });
30
41
  });
31
42
  });
@@ -4,7 +4,7 @@ import * as R from "ramda";
4
4
  import { getPathAttributes } from "@applicaster/zapp-react-native-utils/navigationUtils";
5
5
  import { ScreenResolver } from "@applicaster/zapp-react-native-ui-components/Components/ScreenResolver";
6
6
 
7
- import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks/navigation";
7
+ import { useRoute } from "@applicaster/zapp-react-native-utils/reactHooks/navigation";
8
8
 
9
9
  type Props = any;
10
10
 
@@ -14,7 +14,8 @@ type Props = any;
14
14
  * @param {Props}: see props above
15
15
  */
16
16
  export const RouteManager = React.memo(function RouteManager(props: Props) {
17
- const { currentRoute: pathname, screenData } = useNavigation();
17
+ const { pathname, screenData } = useRoute();
18
+
18
19
  const pathAttributes = getPathAttributes({ pathname });
19
20
 
20
21
  if (!pathAttributes.length) {
@@ -15,6 +15,11 @@ jest.mock(
15
15
  // This is meant to silence errors with react-native-gesture-handler
16
16
  jest.mock("../ModalProvider/ModalBottomSheet", () => () => null);
17
17
 
18
+ jest.mock(
19
+ "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation",
20
+ () => () => null
21
+ );
22
+
18
23
  jest.mock("react-native-safe-area-context", () => ({
19
24
  SafeAreaProvider: jest.fn(
20
25
  () =>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/quick-brick-core",
3
- "version": "12.0.0-alpha.3977160850",
3
+ "version": "12.0.0-alpha.4374801485",
4
4
  "description": "Core package for Applicaster's Quick Brick App",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -30,13 +30,13 @@
30
30
  },
31
31
  "homepage": "https://github.com/applicaster/quickbrick#readme",
32
32
  "dependencies": {
33
- "@applicaster/applicaster-types": "12.0.0-alpha.3977160850",
34
- "@applicaster/quick-brick-core-plugins": "12.0.0-alpha.3977160850",
35
- "@applicaster/zapp-pipes-v2-client": "12.0.0-alpha.3977160850",
36
- "@applicaster/zapp-react-native-bridge": "12.0.0-alpha.3977160850",
37
- "@applicaster/zapp-react-native-redux": "12.0.0-alpha.3977160850",
38
- "@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.3977160850",
39
- "@applicaster/zapp-react-native-utils": "12.0.0-alpha.3977160850",
33
+ "@applicaster/applicaster-types": "12.0.0-alpha.4374801485",
34
+ "@applicaster/quick-brick-core-plugins": "12.0.0-alpha.4374801485",
35
+ "@applicaster/zapp-pipes-v2-client": "12.0.0-alpha.4374801485",
36
+ "@applicaster/zapp-react-native-bridge": "12.0.0-alpha.4374801485",
37
+ "@applicaster/zapp-react-native-redux": "12.0.0-alpha.4374801485",
38
+ "@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.4374801485",
39
+ "@applicaster/zapp-react-native-utils": "12.0.0-alpha.4374801485",
40
40
  "atob": "^2.1.2",
41
41
  "axios": "^0.28.0",
42
42
  "btoa": "^1.2.1",