@applicaster/quick-brick-core 12.0.0-rc.34 → 12.0.0-rc.36

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.
@@ -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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/quick-brick-core",
3
- "version": "12.0.0-rc.34",
3
+ "version": "12.0.0-rc.36",
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-rc.34",
34
- "@applicaster/quick-brick-core-plugins": "12.0.0-rc.34",
35
- "@applicaster/zapp-pipes-v2-client": "12.0.0-rc.34",
36
- "@applicaster/zapp-react-native-bridge": "12.0.0-rc.34",
37
- "@applicaster/zapp-react-native-redux": "12.0.0-rc.34",
38
- "@applicaster/zapp-react-native-ui-components": "12.0.0-rc.34",
39
- "@applicaster/zapp-react-native-utils": "12.0.0-rc.34",
33
+ "@applicaster/applicaster-types": "12.0.0-rc.36",
34
+ "@applicaster/quick-brick-core-plugins": "12.0.0-rc.36",
35
+ "@applicaster/zapp-pipes-v2-client": "12.0.0-rc.36",
36
+ "@applicaster/zapp-react-native-bridge": "12.0.0-rc.36",
37
+ "@applicaster/zapp-react-native-redux": "12.0.0-rc.36",
38
+ "@applicaster/zapp-react-native-ui-components": "12.0.0-rc.36",
39
+ "@applicaster/zapp-react-native-utils": "12.0.0-rc.36",
40
40
  "atob": "^2.1.2",
41
41
  "axios": "^0.28.0",
42
42
  "btoa": "^1.2.1",