Last active
December 14, 2017 17:05
-
-
Save theskillwithin/74f3642903f93299d4c908b00c7dfd53 to your computer and use it in GitHub Desktop.
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 configureStore from 'redux-mock-store' | |
import { shallow } from 'enzyme' | |
import Page from 'components/Page' | |
import { Provider } from 'react-redux' | |
const mockStore = configureStore({ | |
cobrand: '', | |
user: {}, | |
activeInstalls: false, | |
activeInstall: false, | |
}) | |
describe('Page', () => { | |
const onClick = jest.fn() | |
let page | |
beforeEach(() => { | |
page = shallow(<Provider store={mockStore()}><Page /></Provider>) | |
}) | |
it('should match snapshot', () => { | |
expect(Page).toMatchSnapshot() | |
}) | |
it('should have header large classname if props.header is large', () => { | |
page.setProps({ | |
header: 'large', | |
}) | |
expect(page.find('.mm-header-large')).toBeTruthy() | |
}) | |
it('should have header classname if props.header is not large', () => { | |
page.setProps({ | |
header: false, | |
}) | |
expect(page.find('.mm-header-large')).toBeTruthy() | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment