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

20 lines
528 B
JavaScript

import React from "react";
import { render } from "@testing-library/react";
import { Router } from "react-router";
import { createMemoryHistory } from "history";
import App from "./App";
import { Provider } from "react-redux";
import smartHutStore from "./store";
test("redirects to homepage", () => {
const history = createMemoryHistory();
render(
<Router history={history}>
<Provider store={smartHutStore}>
<App />
</Provider>
</Router>
);
expect(history.location.pathname).toBe("/");
});