Skip to content

Instantly share code, notes, and snippets.

@ovidiuch
Last active April 23, 2018 15:38
Show Gist options
  • Save ovidiuch/699e338399e2f45f2b36cb9e79fe915b to your computer and use it in GitHub Desktop.
Save ovidiuch/699e338399e2f45f2b36cb9e79fe915b to your computer and use it in GitHub Desktop.
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