Last active
April 23, 2018 15:38
-
-
Save ovidiuch/699e338399e2f45f2b36cb9e79fe915b to your computer and use it in GitHub Desktop.
This file contains hidden or 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 createTestContext from 'react-cosmos-test/enzyme'; | |
import fixture from './logged-in.fixture'; | |
const { mount, getWrapper, get } = createTestContext({ fixture }); | |
beforeEach(mount); | |
test('welcomes logged in user by name', () => { | |
expect(getWrapper('.welcome').text()).toContain('Dan'); | |
}); | |
test('redirects to home page after signing out', () => { | |
getWrapper('.logout-btn').simulate('click'); | |
expect(get('url')).toBe('/'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment