2020-03-23 20:24:17 +00:00
|
|
|
import React from "react";
|
|
|
|
import { render } from "@testing-library/react";
|
2020-03-07 10:59:04 +00:00
|
|
|
import { Router } from "react-router";
|
|
|
|
import { createMemoryHistory } from "history";
|
2020-03-23 20:24:17 +00:00
|
|
|
import App from "./App";
|
2020-02-24 14:22:19 +00:00
|
|
|
|
2020-03-07 10:59:04 +00:00
|
|
|
test("redirects to homepage", () => {
|
|
|
|
const history = createMemoryHistory();
|
|
|
|
render(
|
|
|
|
<Router history={history}>
|
|
|
|
<App />
|
|
|
|
</Router>
|
|
|
|
);
|
|
|
|
expect(history.location.pathname).toBe("/");
|
2020-02-24 14:22:19 +00:00
|
|
|
});
|