Last active
December 15, 2018 05:33
-
-
Save adeelibr/ac60da132758c7ebbcb30e28672975fe to your computer and use it in GitHub Desktop.
Jest-Enzyme-Config-Article Part-5
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 { shallow } from ‘enzyme’; | |
// Components | |
import WelcomeMessage from './WelcomeMessage'; | |
function setup() { | |
const props = { | |
imgPath: 'some/image/path/to/a/mock/image', | |
}; | |
const wrapper = shallow(<WelcomeMessage />); | |
return { wrapper, props }; | |
} | |
describe('WelcomeMessage Test Suite', () => { | |
it('Should have an image', () => { | |
const { wrapper } = setup(); | |
expect(wrapper.find('img').exists()).toBe(true); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment