Created
April 25, 2016 05:19
-
-
Save Magomogo/dc2142e786bb04153a102578b331476d to your computer and use it in GitHub Desktop.
Shallow + intl
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 { shallow } from 'enzyme'; | |
import { SimpleSearch } from '../../src/containers/SimpleSearch'; | |
import { IntlProvider } from 'react-intl'; | |
const intlProvider = new IntlProvider({locale: 'en'}, {}); | |
describe('<SimpleSearch/>', () => { | |
let wrapper, {intl} = intlProvider.getChildContext(); | |
beforeEach(() => { | |
wrapper = shallow(<SimpleSearch/>, { context: { intl } }); | |
}); | |
it('renders', () => { | |
console.log(wrapper.html()); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
an example on how to test containers and components enhanced with react-intl is here: stoeffel/react-redux-bp@74af0b8