Created
November 13, 2018 10:20
-
-
Save thiagoferreiraw/0cd25bc76b5b47e12de3a0dcf4a20bfd to your computer and use it in GitHub Desktop.
App.test.js - Com snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import App from './App'; | |
import { mount } from 'enzyme'; | |
import toJson from "enzyme-to-json" | |
it("should render the homepage for the non logged in user", () => { | |
const props = { | |
isLoggedIn: false, | |
username: null | |
} | |
const app = mount(<App {...props} />) | |
expect(toJson(app)).toMatchSnapshot() | |
}) | |
it("should render the Homepage for the logged in user (Heisenberg)", () => { | |
const props = { | |
isLoggedIn: true, | |
username: "Heisenberg" | |
} | |
const app = mount(<App {...props} />) | |
expect(toJson(app)).toMatchSnapshot() | |
}) | |
it("should render the Homepage for the logged in user without tasks", () => { | |
const props = { | |
isLoggedIn: true, | |
username: "Jesse" | |
} | |
const app = mount(<App {...props} />) | |
expect(toJson(app)).toMatchSnapshot() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment