frontend/smart-hut/src/App.test.js

20 lines
528 B
JavaScript
Raw Normal View History

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-04-12 15:49:29 +00:00
import { Provider } from "react-redux";
import smartHutStore from "./store";
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}>
2020-04-12 15:49:29 +00:00
<Provider store={smartHutStore}>
<App />
</Provider>
2020-03-07 10:59:04 +00:00
</Router>
);
expect(history.location.pathname).toBe("/");
2020-02-24 14:22:19 +00:00
});