Files
gog_frontend/src/components/UnauthenticatedApp-snapshot.test.jsx
Deepak a4b4cddb36
All checks were successful
gitea-deepak/gog_frontend/pipeline/head This commit looks good
Adds snapshot tests for authenticated app and unauthenticated app components, which now logout properly
2021-01-24 19:10:56 -06:00

18 lines
485 B
JavaScript

import React from "react";
import renderer from "react-test-renderer";
import UnauthenticatedApp from "./UnauthenticatedApp";
import { AuthContext } from "../context/AuthContext";
test("UnauthenticatedApp Snapshot", () => {
const appRender = renderer.create(
<AuthContext.Provider value={{ login: jest.fn(), register: jest.fn(), logout: jest.fn() }}>
<UnauthenticatedApp />
</AuthContext.Provider>
);
const tree = appRender.toJSON();
expect(tree).toMatchSnapshot();
});