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

16 lines
392 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";
test("redirects to homepage", () => {
const history = createMemoryHistory();
render(
<Router history={history}>
<App />
</Router>
);
expect(history.location.pathname).toBe("/");
});