@applicaster/quick-brick-core 13.0.0-rc.5 → 13.0.0-rc.51
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/App/ActionsProvider/__tests__/__snapshots__/ActionsProvider.test.js.snap +7 -7
- package/App/AssetCache/__tests__/__snapshots__/assetCache.test.ts.snap +103 -103
- package/App/AssetCache/__tests__/assetCache.test.ts +3 -2
- package/App/DeepLinking/URLSchemeHandler/SchemeHandlerHooks/__tests__/__snapshots__/schemeHandlerHooks.test.ts.snap +1 -1
- package/App/DeepLinking/URLSchemeHandler/SchemeHandlerHooks/__tests__/useOpenSchemeHandler.test.tsx +45 -116
- package/App/DeepLinking/URLSchemeHandler/__tests__/__snapshots__/URLSchemeHandler.test.tsx.snap +3 -3
- package/App/DeepLinking/URLSchemeListener/URLSchemeContextProvider.tsx +30 -3
- package/App/DeepLinking/URLSchemeListener/__tests__/URLSchemeListener.test.js +40 -0
- package/App/DeepLinking/URLSchemeListener/index.tsx +1 -1
- package/App/ErrorBoundary/__tests__/errorBoundary.test.js +20 -37
- package/App/LoadingOverlay/LoadingOverlayManager.tsx +27 -0
- package/App/LoadingOverlay/index.tsx +49 -0
- package/App/LoadingOverlay/useLoadingOverlayVisibility.tsx +18 -0
- package/App/ModalProvider/ModalBottomSheet/index.tsx +4 -2
- package/App/ModalProvider/index.tsx +3 -4
- package/App/NavigationProvider/NavigationProvider.tsx +48 -20
- package/App/NavigationProvider/__tests__/__snapshots__/navigationProvider.test.tsx.snap +20 -22
- package/App/NavigationProvider/navigator/__tests__/__snapshots__/reducer.test.ts.snap +189 -189
- package/App/RouteManager/__tests__/__snapshots__/routeManager.test.js.snap +2 -2
- package/App/StoreConnector/__tests__/storeConnector.test.js +17 -11
- package/App/appLifeCycleManager/__tests__/__snapshots__/appLifeCycleManager.test.js.snap +4 -4
- package/App/appLifeCycleManager/__tests__/appLifeCycleManager.test.js +5 -5
- package/App/appLifeCycleManager/index.tsx +2 -3
- package/App/index.tsx +2 -0
- package/App/remoteContextReloader/__tests__/remoteContextReloader.test.js +11 -21
- package/App/remoteContextReloader/consts.ts +2 -0
- package/App/remoteContextReloader/getRemoteContextData/getNativeRemoteContextData.ts +17 -6
- package/createZappApp/__tests__/__snapshots__/createZappApp.test.js.snap +5 -128
- package/createZappApp/__tests__/createZappApp.test.js +7 -20
- package/defaults/__tests__/defaults.test.js +3 -4
- package/index.d.ts +1 -1
- package/package.json +27 -11
- package/App/DeepLinking/URLSchemeListener/__tests__/URLSchemeListenerTest.js +0 -177
- package/App/ErrorBoundary/__tests__/__snapshots__/errorBoundary.test.js.snap +0 -9
- package/App/StoreConnector/__tests__/__snapshots__/storeConnector.test.js.snap +0 -35
- package/App/remoteContextReloader/__tests__/__snapshots__/remoteContextReloader.test.js.snap +0 -43
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as ReactIs from "react-is";
|
|
3
3
|
import { View, Text } from "react-native";
|
|
4
|
-
import {
|
|
5
|
-
import { shallowToJson } from "enzyme-to-json";
|
|
4
|
+
import { render } from "@testing-library/react-native";
|
|
6
5
|
import configureStore from "redux-mock-store";
|
|
7
6
|
|
|
8
7
|
import { storeConnector } from "../index";
|
|
8
|
+
import { Provider } from "react-redux";
|
|
9
9
|
|
|
10
10
|
const styles = { foo: "bar" };
|
|
11
11
|
const components = { grid: jest.fn() };
|
|
12
12
|
const rivers = { A123: { name: "home", id: "A123" } };
|
|
13
13
|
const appSettings = { bundleIdentifier: "com.app.test" };
|
|
14
14
|
|
|
15
|
-
const Component = () => (
|
|
16
|
-
<View>
|
|
15
|
+
const Component = (props) => (
|
|
16
|
+
<View testID="test-comp" {...props}>
|
|
17
17
|
<Text>I'm a component</Text>
|
|
18
18
|
</View>
|
|
19
19
|
);
|
|
@@ -28,7 +28,6 @@ const store = configureStore()({
|
|
|
28
28
|
describe("storeConnector", () => {
|
|
29
29
|
it("returns a Component", () => {
|
|
30
30
|
const WrappedComponent = storeConnector(Component);
|
|
31
|
-
|
|
32
31
|
expect(ReactIs.isValidElementType(WrappedComponent)).toBe(true);
|
|
33
32
|
|
|
34
33
|
expect(WrappedComponent).toEqual(
|
|
@@ -41,12 +40,19 @@ describe("storeConnector", () => {
|
|
|
41
40
|
|
|
42
41
|
it("passes the props to the component", () => {
|
|
43
42
|
const WrappedComponent = storeConnector(Component);
|
|
44
|
-
const wrapper = shallow(<WrappedComponent store={store} />).dive();
|
|
45
|
-
const wrapperProps = wrapper.first().props();
|
|
46
43
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
const { getByText, getByTestId } = render(
|
|
45
|
+
<Provider store={store}>
|
|
46
|
+
<WrappedComponent />
|
|
47
|
+
</Provider>
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
expect(getByText("I'm a component")).toBeTruthy();
|
|
51
|
+
|
|
52
|
+
expect(getByTestId("test-comp").props).toMatchObject({
|
|
53
|
+
appSettings,
|
|
54
|
+
components,
|
|
55
|
+
rivers,
|
|
56
|
+
});
|
|
51
57
|
});
|
|
52
58
|
});
|
|
@@ -17,10 +17,10 @@ exports[`appLifeCycleManager sends the quickBrickReady event when a loader doesn
|
|
|
17
17
|
`;
|
|
18
18
|
|
|
19
19
|
exports[`appLifeCycleManager sends the quickBrickReady event when a loader doesn't resolves 2`] = `
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"data":
|
|
20
|
+
[
|
|
21
|
+
[
|
|
22
|
+
{
|
|
23
|
+
"data": {
|
|
24
24
|
"error": [Error: loading failed],
|
|
25
25
|
},
|
|
26
26
|
"message": "AppLifeCycleManager: A loading operation failed: loading failed",
|
|
@@ -8,7 +8,7 @@ const Component = () => (
|
|
|
8
8
|
</View>
|
|
9
9
|
);
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const mockLogger = {
|
|
12
12
|
warning: jest.fn(),
|
|
13
13
|
log: jest.fn(),
|
|
14
14
|
debug: jest.fn(),
|
|
@@ -17,7 +17,7 @@ const logger = {
|
|
|
17
17
|
|
|
18
18
|
jest.mock("../../logger", () => ({
|
|
19
19
|
coreAppLogger: {
|
|
20
|
-
addSubsystem: jest.fn(() =>
|
|
20
|
+
addSubsystem: jest.fn(() => mockLogger),
|
|
21
21
|
},
|
|
22
22
|
}));
|
|
23
23
|
|
|
@@ -45,7 +45,7 @@ const QUICK_BRICK_READY_EVENT = "quickBrickReady";
|
|
|
45
45
|
|
|
46
46
|
const actions = {};
|
|
47
47
|
|
|
48
|
-
jest.
|
|
48
|
+
jest.doMock("@applicaster/zapp-react-native-utils/reactHooks/actions", () => ({
|
|
49
49
|
useActions: jest.fn(() => ({ actions })),
|
|
50
50
|
}));
|
|
51
51
|
|
|
@@ -55,7 +55,7 @@ describe("appLifeCycleManager", () => {
|
|
|
55
55
|
const decorator = appLifeCycleManager(appLoader, QuickBrickManager);
|
|
56
56
|
|
|
57
57
|
beforeEach(() => {
|
|
58
|
-
|
|
58
|
+
mockLogger.warning.mockClear();
|
|
59
59
|
appLoader.mockClear();
|
|
60
60
|
QuickBrickManager.sendQuickBrickEvent.mockClear();
|
|
61
61
|
dispatch.mockClear();
|
|
@@ -111,7 +111,7 @@ describe("appLifeCycleManager", () => {
|
|
|
111
111
|
QUICK_BRICK_READY_EVENT
|
|
112
112
|
);
|
|
113
113
|
|
|
114
|
-
expect(
|
|
114
|
+
expect(mockLogger.warning.mock.calls).toMatchSnapshot();
|
|
115
115
|
|
|
116
116
|
done();
|
|
117
117
|
};
|
|
@@ -131,9 +131,8 @@ export function appLifeCycleManager(appLoader, QuickBrickManager) {
|
|
|
131
131
|
)
|
|
132
132
|
.map((plugin: any) => plugin.module?.getLoginProtocol?.());
|
|
133
133
|
|
|
134
|
-
const loginProtocols: LoginProtocol[] =
|
|
135
|
-
promiseProtocols
|
|
136
|
-
);
|
|
134
|
+
const loginProtocols: LoginProtocol[] =
|
|
135
|
+
await Promise.all(promiseProtocols);
|
|
137
136
|
|
|
138
137
|
// Await all does not work here
|
|
139
138
|
for (const protocol of loginProtocols) {
|
package/App/index.tsx
CHANGED
|
@@ -29,6 +29,7 @@ import { appRemoteDataLoader } from "./appRemoteDataLoader";
|
|
|
29
29
|
import { withActionExecutor } from "@applicaster/zapp-react-native-utils/actionsExecutor/ActionExecutorContext";
|
|
30
30
|
import { withScreenDataContextProvider } from "@applicaster/zapp-react-native-ui-components/Contexts/ScreenDataContext";
|
|
31
31
|
import { LogicAggregatorContainer } from "./LogicAggregatorContainer";
|
|
32
|
+
import { LoadingOverlay } from "./LoadingOverlay";
|
|
32
33
|
|
|
33
34
|
interface AppOptions {
|
|
34
35
|
Layout: React.ComponentType;
|
|
@@ -74,6 +75,7 @@ const App = ({
|
|
|
74
75
|
<LogicAggregatorContainer
|
|
75
76
|
components={[InteractionManager, ApplyScreenHooks]}
|
|
76
77
|
/>
|
|
78
|
+
<LoadingOverlay />
|
|
77
79
|
</ErrorBoundary>
|
|
78
80
|
</AppContainer>
|
|
79
81
|
</SafeAreaProvider>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { View, Text } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
import { shallowToJson } from "enzyme-to-json";
|
|
3
|
+
import { render } from "@testing-library/react-native";
|
|
5
4
|
|
|
6
5
|
import { remoteContextReloader } from "../index";
|
|
7
6
|
import * as ContextReloader from "../getRemoteContextData";
|
|
@@ -25,19 +24,21 @@ const dispatch = jest.fn();
|
|
|
25
24
|
|
|
26
25
|
describe("remoteContextReloader", () => {
|
|
27
26
|
const WrappedComponent = remoteContextReloader(Component);
|
|
27
|
+
let rendered;
|
|
28
|
+
|
|
29
|
+
beforeEach(() => {
|
|
30
|
+
rendered = render(
|
|
31
|
+
<WrappedComponent {...{ appSettings, plugins, dispatch }} />
|
|
32
|
+
);
|
|
33
|
+
});
|
|
28
34
|
|
|
29
35
|
afterEach(() => {
|
|
30
36
|
jest.clearAllMocks();
|
|
31
37
|
});
|
|
32
38
|
|
|
33
|
-
it("
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
expect(shallowToJson(wrapper)).toMatchSnapshot();
|
|
39
|
-
expect(wrapper.instance()).toHaveProperty("componentDidMount");
|
|
40
|
-
expect(wrapper.instance().componentDidMount).toBeFunction();
|
|
39
|
+
it("calls componentDidMount and renders correctly", () => {
|
|
40
|
+
const { getByText } = rendered;
|
|
41
|
+
expect(getByText("I'm a component")).toBeTruthy();
|
|
41
42
|
});
|
|
42
43
|
|
|
43
44
|
describe("when in __DEV__", () => {
|
|
@@ -47,11 +48,6 @@ describe("remoteContextReloader", () => {
|
|
|
47
48
|
});
|
|
48
49
|
|
|
49
50
|
it("doesn't invoke the context reloader", () => {
|
|
50
|
-
const wrapper = shallow(
|
|
51
|
-
<WrappedComponent {...{ appSettings, plugins, dispatch }} />
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
expect(shallowToJson(wrapper)).toMatchSnapshot();
|
|
55
51
|
expect(spy).not.toHaveBeenCalled();
|
|
56
52
|
});
|
|
57
53
|
});
|
|
@@ -62,12 +58,6 @@ describe("remoteContextReloader", () => {
|
|
|
62
58
|
});
|
|
63
59
|
|
|
64
60
|
it("invokes the context reloader", () => {
|
|
65
|
-
const wrapper = shallow(
|
|
66
|
-
<WrappedComponent {...{ appSettings, plugins, dispatch }} />
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
expect(shallowToJson(wrapper)).toMatchSnapshot();
|
|
70
|
-
|
|
71
61
|
expect(spy).toHaveBeenCalledWith(
|
|
72
62
|
dispatch,
|
|
73
63
|
appSettings.runtimeConfigurationUrls,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as R from "ramda";
|
|
2
|
-
import { Dimensions } from "react-native";
|
|
2
|
+
import { Dimensions, NativeModules } from "react-native";
|
|
3
3
|
import { loadAppContextData } from "@applicaster/zapp-react-native-redux";
|
|
4
4
|
import { isTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
5
5
|
import { mapPromises } from "@applicaster/zapp-react-native-utils/arrayUtils";
|
|
@@ -7,6 +7,9 @@ import { fetchPluginConfiguration, getPromiseForType } from "../helpers";
|
|
|
7
7
|
import { cacheAssets } from "../../AssetCache";
|
|
8
8
|
import { actions as appDataActions } from "@applicaster/zapp-react-native-redux/AppData";
|
|
9
9
|
import { logger } from "@applicaster/zapp-react-native-utils/logger";
|
|
10
|
+
import { ACTIVE_LAYOUT_ID_STORAGE_KEY } from "../consts";
|
|
11
|
+
const { AppLoaderBridge } = NativeModules;
|
|
12
|
+
import { localStorage } from "@applicaster/zapp-react-native-bridge/ZappStorage/LocalStorage";
|
|
10
13
|
|
|
11
14
|
export async function getNativeRemoteContextData(
|
|
12
15
|
dispatch,
|
|
@@ -33,11 +36,19 @@ export async function getNativeRemoteContextData(
|
|
|
33
36
|
R.pathSatisfies(R.is(Function), ["module", "selectLayout"])
|
|
34
37
|
)(plugins);
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
if (layoutManagerPlugin) {
|
|
40
|
+
await layoutManagerPlugin.module?.selectLayout({
|
|
41
|
+
runtimeConfigurationUrls,
|
|
42
|
+
plugin: layoutManagerPlugin,
|
|
43
|
+
isTablet: isTabletDevice,
|
|
44
|
+
});
|
|
45
|
+
} else {
|
|
46
|
+
const layoutId = await localStorage.getItem(ACTIVE_LAYOUT_ID_STORAGE_KEY);
|
|
47
|
+
|
|
48
|
+
if (layoutId) {
|
|
49
|
+
await AppLoaderBridge?.switchLayout(layoutId, null);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
41
52
|
} catch (error) {
|
|
42
53
|
logger.error({
|
|
43
54
|
message: "Error selecting layout using layout manager plugin",
|
|
@@ -1,132 +1,9 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`createZappApp has a <Provider /> component with an initialized store 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"appData": Object {
|
|
6
|
-
"countryLocale": "GB",
|
|
7
|
-
"languageLocale": "en",
|
|
8
|
-
"layoutVersion": "v1",
|
|
9
|
-
"quickBrickEvent": [MockFunction],
|
|
10
|
-
},
|
|
11
|
-
"appSettings": Object {
|
|
12
|
-
"runtimeConfigurationUrls": Object {},
|
|
13
|
-
},
|
|
14
|
-
"appState": Object {
|
|
15
|
-
"appLaunched": false,
|
|
16
|
-
"appReady": false,
|
|
17
|
-
"appState": Object {
|
|
18
|
-
"currentState": null,
|
|
19
|
-
"eventType": null,
|
|
20
|
-
"isAvailable": null,
|
|
21
|
-
"nextState": null,
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
"cellStyles": Object {},
|
|
25
|
-
"components": Object {
|
|
26
|
-
"AppContainer": [Function],
|
|
27
|
-
"ContentScreen": [Function],
|
|
28
|
-
"HookRenderer": [Function],
|
|
29
|
-
"ModalComponent": [Function],
|
|
30
|
-
"PlayerContainer": Object {
|
|
31
|
-
"$$typeof": Symbol(react.memo),
|
|
32
|
-
"WrappedComponent": Object {
|
|
33
|
-
"$$typeof": Symbol(react.memo),
|
|
34
|
-
"compare": null,
|
|
35
|
-
"type": [Function],
|
|
36
|
-
},
|
|
37
|
-
"compare": null,
|
|
38
|
-
"type": [Function],
|
|
39
|
-
},
|
|
40
|
-
"QBImage": [Function],
|
|
41
|
-
"River": Object {
|
|
42
|
-
"$$typeof": Symbol(react.memo),
|
|
43
|
-
"WrappedComponent": [Function],
|
|
44
|
-
"compare": null,
|
|
45
|
-
"type": [Function],
|
|
46
|
-
},
|
|
47
|
-
"TextInputTv": Object {
|
|
48
|
-
"$$typeof": Symbol(react.forward_ref),
|
|
49
|
-
"render": [Function],
|
|
50
|
-
},
|
|
51
|
-
"Touchable": [Function],
|
|
52
|
-
},
|
|
53
|
-
"contentTypes": null,
|
|
54
|
-
"localizations": Object {},
|
|
55
|
-
"pipesEndpoints": null,
|
|
56
|
-
"pluginConfigurations": Object {
|
|
57
|
-
"pc1": Object {
|
|
58
|
-
"configuration_json": null,
|
|
59
|
-
"plugin": Object {
|
|
60
|
-
"api": Object {},
|
|
61
|
-
"identifier": "pc1",
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
"pc2": Object {
|
|
65
|
-
"configuration_json": Object {
|
|
66
|
-
"foo": "bar",
|
|
67
|
-
},
|
|
68
|
-
"plugin": Object {
|
|
69
|
-
"api": Object {},
|
|
70
|
-
"identifier": "pc2",
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
"plugins": Array [
|
|
75
|
-
Object {
|
|
76
|
-
"configuration": null,
|
|
77
|
-
"identifier": "pc1",
|
|
78
|
-
"module": [MockFunction],
|
|
79
|
-
"name": "Plugin1",
|
|
80
|
-
"type": "general",
|
|
81
|
-
},
|
|
82
|
-
Object {
|
|
83
|
-
"configuration": Object {
|
|
84
|
-
"foo": "bar",
|
|
85
|
-
},
|
|
86
|
-
"identifier": "pc2",
|
|
87
|
-
"module": [MockFunction],
|
|
88
|
-
"name": "Plugin2",
|
|
89
|
-
"type": "general",
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
"presetsMapping": Object {},
|
|
93
|
-
"remoteConfigurations": Object {
|
|
94
|
-
"localizations": Object {},
|
|
95
|
-
},
|
|
96
|
-
"rivers": Object {},
|
|
97
|
-
"styles": Object {},
|
|
98
|
-
"zappPipes": Object {},
|
|
99
|
-
}
|
|
100
|
-
`;
|
|
101
|
-
|
|
102
3
|
exports[`createZappApp renders the provided React App 1`] = `
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
"getState": [Function],
|
|
109
|
-
"replaceReducer": [Function],
|
|
110
|
-
"subscribe": [Function],
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
>
|
|
114
|
-
<EmptyZappApp />
|
|
115
|
-
</Provider>
|
|
116
|
-
`;
|
|
117
|
-
|
|
118
|
-
exports[`createZappApp returns a react component 1`] = `
|
|
119
|
-
<Provider
|
|
120
|
-
store={
|
|
121
|
-
Object {
|
|
122
|
-
"@@observable": [Function],
|
|
123
|
-
"dispatch": [Function],
|
|
124
|
-
"getState": [Function],
|
|
125
|
-
"replaceReducer": [Function],
|
|
126
|
-
"subscribe": [Function],
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
>
|
|
130
|
-
<EmptyZappApp />
|
|
131
|
-
</Provider>
|
|
4
|
+
<View>
|
|
5
|
+
<Text>
|
|
6
|
+
Welcome to the QuickBrick App
|
|
7
|
+
</Text>
|
|
8
|
+
</View>
|
|
132
9
|
`;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { View, Text } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
import { shallowToJson } from "enzyme-to-json";
|
|
3
|
+
import { render, screen } from "@testing-library/react-native";
|
|
5
4
|
import QuickBrickComponents from "@applicaster/zapp-react-native-ui-components";
|
|
6
5
|
import { Provider } from "react-redux";
|
|
7
6
|
|
|
@@ -77,27 +76,17 @@ jest.mock("@applicaster/zapp-react-native-bridge/QuickBrick", () => ({
|
|
|
77
76
|
}));
|
|
78
77
|
|
|
79
78
|
describe("createZappApp", () => {
|
|
80
|
-
it("returns a react component", () => {
|
|
81
|
-
const ZappApp = createZappApp({});
|
|
82
|
-
const wrapper = shallow(<ZappApp />);
|
|
83
|
-
|
|
84
|
-
expect(shallowToJson(wrapper)).toMatchSnapshot();
|
|
85
|
-
});
|
|
86
|
-
|
|
87
79
|
it("renders the provided React App", () => {
|
|
88
80
|
const ZappApp = createZappApp({ App });
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
expect(shallowToJson(wrapper)).toMatchSnapshot();
|
|
81
|
+
render(<ZappApp />);
|
|
82
|
+
expect(screen.toJSON()).toMatchSnapshot();
|
|
92
83
|
});
|
|
93
84
|
|
|
94
|
-
it("has a
|
|
85
|
+
it("has a Provider component with an initialized store", () => {
|
|
95
86
|
const ZappApp = createZappApp(zappAppConfig);
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
const store = providerNode.prop("store");
|
|
100
|
-
expect(providerNode.length).toBe(1);
|
|
87
|
+
const { UNSAFE_root } = render(<ZappApp />);
|
|
88
|
+
const providerInstance = UNSAFE_root.findByType(Provider);
|
|
89
|
+
const store = providerInstance.props.store;
|
|
101
90
|
|
|
102
91
|
expect(store).toEqual(
|
|
103
92
|
expect.objectContaining({
|
|
@@ -108,8 +97,6 @@ describe("createZappApp", () => {
|
|
|
108
97
|
})
|
|
109
98
|
);
|
|
110
99
|
|
|
111
|
-
expect(store.getState()).toMatchSnapshot();
|
|
112
|
-
|
|
113
100
|
expect(store.getState()).toEqual(
|
|
114
101
|
expect.objectContaining({
|
|
115
102
|
styles: expect.any(Object),
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { render } from "@testing-library/react-native";
|
|
2
3
|
import { EmptyZappApp } from "../index";
|
|
3
|
-
import { shallow } from "enzyme";
|
|
4
|
-
import { shallowToJson } from "enzyme-to-json";
|
|
5
4
|
|
|
6
5
|
describe("<EmptyZappApp />", () => {
|
|
7
6
|
it("renders correctly", () => {
|
|
8
|
-
const
|
|
9
|
-
expect(
|
|
7
|
+
const { toJSON } = render(<EmptyZappApp />);
|
|
8
|
+
expect(toJSON()).toMatchSnapshot();
|
|
10
9
|
});
|
|
11
10
|
});
|
package/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ type AnyValue = void | string | number | boolean | AnyArray | AnyRecord;
|
|
|
24
24
|
declare type ReducerAction<
|
|
25
25
|
T extends string = string,
|
|
26
26
|
P extends AnyValue = AnyValue,
|
|
27
|
-
M extends AnyRecord = AnyRecord
|
|
27
|
+
M extends AnyRecord = AnyRecord,
|
|
28
28
|
> = {
|
|
29
29
|
type: T;
|
|
30
30
|
payload?: P;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-core",
|
|
3
|
-
"version": "13.0.0-rc.
|
|
3
|
+
"version": "13.0.0-rc.51",
|
|
4
4
|
"description": "Core package for Applicaster's Quick Brick App",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@applicaster/applicaster-types": "13.0.0-rc.
|
|
33
|
-
"@applicaster/quick-brick-core-plugins": "13.0.0-rc.
|
|
34
|
-
"@applicaster/zapp-pipes-v2-client": "13.0.0-rc.
|
|
35
|
-
"@applicaster/zapp-react-native-bridge": "13.0.0-rc.
|
|
36
|
-
"@applicaster/zapp-react-native-redux": "13.0.0-rc.
|
|
37
|
-
"@applicaster/zapp-react-native-ui-components": "13.0.0-rc.
|
|
38
|
-
"@applicaster/zapp-react-native-utils": "13.0.0-rc.
|
|
32
|
+
"@applicaster/applicaster-types": "13.0.0-rc.51",
|
|
33
|
+
"@applicaster/quick-brick-core-plugins": "13.0.0-rc.51",
|
|
34
|
+
"@applicaster/zapp-pipes-v2-client": "13.0.0-rc.51",
|
|
35
|
+
"@applicaster/zapp-react-native-bridge": "13.0.0-rc.51",
|
|
36
|
+
"@applicaster/zapp-react-native-redux": "13.0.0-rc.51",
|
|
37
|
+
"@applicaster/zapp-react-native-ui-components": "13.0.0-rc.51",
|
|
38
|
+
"@applicaster/zapp-react-native-utils": "13.0.0-rc.51",
|
|
39
39
|
"atob": "^2.1.2",
|
|
40
40
|
"axios": "^0.28.0",
|
|
41
41
|
"btoa": "^1.2.1",
|
|
@@ -50,11 +50,27 @@
|
|
|
50
50
|
"uuid": "3.3.2"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
+
"@applicaster/blur": "*",
|
|
54
|
+
"@applicaster/quick-brick-xray": "*",
|
|
55
|
+
"@applicaster/zapp-react-dom-ui-components": "*",
|
|
56
|
+
"@applicaster/zapp-react-native-tvos-app": "*",
|
|
57
|
+
"@applicaster/zapp-react-native-tvos-ui-components": "*",
|
|
58
|
+
"@babel/runtime": "*",
|
|
53
59
|
"@react-native-community/netinfo": "*",
|
|
54
|
-
"
|
|
55
|
-
"
|
|
60
|
+
"@types/node": "*",
|
|
61
|
+
"immer": "*",
|
|
62
|
+
"react": "*",
|
|
63
|
+
"react-native": "*",
|
|
64
|
+
"react-native-fs": "*",
|
|
56
65
|
"react-native-gesture-handler": "*",
|
|
57
|
-
"react-native-
|
|
66
|
+
"react-native-linear-gradient": "*",
|
|
67
|
+
"react-native-safe-area-context": "*",
|
|
68
|
+
"react-native-svg": "*",
|
|
69
|
+
"react-native-web": "*",
|
|
70
|
+
"react-native-webview": "*",
|
|
71
|
+
"uglify-js": "*",
|
|
72
|
+
"validate-color": "*",
|
|
73
|
+
"zustand": "*"
|
|
58
74
|
},
|
|
59
75
|
"devDependencies": {
|
|
60
76
|
"@types/react-native": "0.69.6",
|