Skip to content

Commit

Permalink
Fix <FinishNavigation> tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pshrmn committed Sep 9, 2018
1 parent 61433a8 commit 1aae6c6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/react-universal/tests/FinishNavigation.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { curi } from "@curi/router";
import InMemory from "@hickory/in-memory";

// resolved by jest
import { CuriProvider, FinishNavigation } from "@curi/react";
import { curiProvider, FinishNavigation } from "@curi/react-universal";

describe("<FinishNavigation>", () => {
let node;
Expand All @@ -22,6 +22,7 @@ describe("<FinishNavigation>", () => {
it('"finishes" navigation after mounting', () => {
const history = InMemory();
const router = curi(history, routes, { suspend: true });
const Router = curiProvider(router);

let navigations = [];
// intercept and mock navigation.finish()
Expand All @@ -34,7 +35,7 @@ describe("<FinishNavigation>", () => {
);

ReactDOM.render(
<CuriProvider router={router}>
<Router>
{({ navigation }) => {
expect(navigation.finish.mock.calls.length).toBe(0);
return (
Expand All @@ -43,7 +44,7 @@ describe("<FinishNavigation>", () => {
</FinishNavigation>
);
}}
</CuriProvider>,
</Router>,
node,
() => {
expect(navigations[0].finish.mock.calls.length).toBe(1);
Expand All @@ -54,6 +55,7 @@ describe("<FinishNavigation>", () => {
it('"finishes" navigation after updating', () => {
const history = InMemory();
const router = curi(history, routes, { suspend: true });
const Router = curiProvider(router);

let navigations = [];
// intercept and mock navigation.finish()
Expand All @@ -66,7 +68,7 @@ describe("<FinishNavigation>", () => {
);

ReactDOM.render(
<CuriProvider router={router}>
<Router>
{({ navigation }) => {
expect(navigation.finish.mock.calls.length).toBe(0);
return (
Expand All @@ -75,7 +77,7 @@ describe("<FinishNavigation>", () => {
</FinishNavigation>
);
}}
</CuriProvider>,
</Router>,
node
);
expect(navigations[0].finish.mock.calls.length).toBe(1);
Expand Down

0 comments on commit 1aae6c6

Please sign in to comment.