@elliemae/pui-app-sdk 4.13.5 → 4.13.6
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.
|
@@ -26,19 +26,18 @@ var import_react = require("@testing-library/react");
|
|
|
26
26
|
var import_react_redux = require("react-redux");
|
|
27
27
|
var import_history = require("history");
|
|
28
28
|
var import_store = require("../../data/store.js");
|
|
29
|
-
var import_history2 = require("../history.js");
|
|
30
29
|
var import_app_router = require("../../view/app-router.js");
|
|
31
|
-
const renderWithRouterRedux = (ui, {
|
|
32
|
-
route = "/",
|
|
33
|
-
history = (0, import_history.createMemoryHistory)({ initialEntries: [route] })
|
|
34
|
-
initialState,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
30
|
+
const renderWithRouterRedux = (ui, options) => {
|
|
31
|
+
const { route = "/", basename = "/", initialState } = options || {};
|
|
32
|
+
const { history = (0, import_history.createMemoryHistory)({ initialEntries: [route] }) } = options || {};
|
|
33
|
+
const { store = (0, import_store.createAppStore)(initialState, history) } = options || {};
|
|
34
|
+
return {
|
|
35
|
+
...(0, import_react.render)(
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_redux.Provider, { store, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_app_router.AppRouter, { basename, history, children: ui }) })
|
|
37
|
+
),
|
|
38
|
+
// adding `store` to the returned utilities to allow us
|
|
39
|
+
// to reference it in our tests (just try to avoid using
|
|
40
|
+
// this to test implementation details).
|
|
41
|
+
store
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -3,22 +3,21 @@ import { render } from "@testing-library/react";
|
|
|
3
3
|
import { Provider } from "react-redux";
|
|
4
4
|
import { createMemoryHistory } from "history";
|
|
5
5
|
import { createAppStore } from "../../data/store.js";
|
|
6
|
-
import { browserHistory } from "../history.js";
|
|
7
6
|
import { AppRouter } from "../../view/app-router.js";
|
|
8
|
-
const renderWithRouterRedux = (ui, {
|
|
9
|
-
route = "/",
|
|
10
|
-
history = createMemoryHistory({ initialEntries: [route] })
|
|
11
|
-
initialState,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
7
|
+
const renderWithRouterRedux = (ui, options) => {
|
|
8
|
+
const { route = "/", basename = "/", initialState } = options || {};
|
|
9
|
+
const { history = createMemoryHistory({ initialEntries: [route] }) } = options || {};
|
|
10
|
+
const { store = createAppStore(initialState, history) } = options || {};
|
|
11
|
+
return {
|
|
12
|
+
...render(
|
|
13
|
+
/* @__PURE__ */ jsx(Provider, { store, children: /* @__PURE__ */ jsx(AppRouter, { basename, history, children: ui }) })
|
|
14
|
+
),
|
|
15
|
+
// adding `store` to the returned utilities to allow us
|
|
16
|
+
// to reference it in our tests (just try to avoid using
|
|
17
|
+
// this to test implementation details).
|
|
18
|
+
store
|
|
19
|
+
};
|
|
20
|
+
};
|
|
22
21
|
export {
|
|
23
22
|
renderWithRouterRedux
|
|
24
23
|
};
|
|
@@ -3,11 +3,12 @@ import { History } from 'history';
|
|
|
3
3
|
import { AppStore, RootState } from '../../data/store.js';
|
|
4
4
|
interface Args {
|
|
5
5
|
initialState: RootState;
|
|
6
|
-
store
|
|
7
|
-
route
|
|
8
|
-
|
|
6
|
+
store?: AppStore;
|
|
7
|
+
route?: string;
|
|
8
|
+
basename?: string;
|
|
9
|
+
history?: History;
|
|
9
10
|
}
|
|
10
|
-
export declare const renderWithRouterRedux: (ui: React.ReactElement,
|
|
11
|
+
export declare const renderWithRouterRedux: (ui: React.ReactElement, options?: Args) => {
|
|
11
12
|
store: import("@reduxjs/toolkit/dist/configureStore.js").ToolkitStore<import("redux").EmptyObject & {
|
|
12
13
|
waitMessage: import("../../data/wait-message/reducer.js").WaitMessageState;
|
|
13
14
|
error: import("../../data/error/index.js").ErrorState;
|