24 lines
533 B
JavaScript
24 lines
533 B
JavaScript
import React from "react";
|
|
import renderer from "react-test-renderer";
|
|
import AuthenticatedApp from "./AuthenticatedApp";
|
|
import { AuthContext } from "../context/AuthContext";
|
|
|
|
test("AuthenticatedApp Snapshot", () => {
|
|
const appRender = renderer.create(
|
|
<AuthContext.Provider
|
|
value={{
|
|
login: jest.fn(),
|
|
register: jest.fn(),
|
|
logout: jest.fn(),
|
|
user: { display_name: "Ted" },
|
|
}}
|
|
>
|
|
<AuthenticatedApp />
|
|
</AuthContext.Provider>
|
|
);
|
|
|
|
const tree = appRender.toJSON();
|
|
|
|
expect(tree).toMatchSnapshot();
|
|
});
|