Skip to content

Instantly share code, notes, and snippets.

@Gethyl
Created January 5, 2017 18:11
Show Gist options
  • Save Gethyl/19e60c3d01597f5f6c37b39239b78e62 to your computer and use it in GitHub Desktop.
Save Gethyl/19e60c3d01597f5f6c37b39239b78e62 to your computer and use it in GitHub Desktop.
Dumb Component Home.js testing.
*********************************
describe('>>>H O M E --- Shallow Render REACT COMPONENTS',()=>{
let wrapper
const output = 10
beforeEach(()=>{
wrapper = shallow(<Home output={output}/>)
})
it('+++ render the DUMB component', () => {
expect(wrapper.length).toEqual(1)
});
it('+++ contains output', () => {
expect(wrapper.find('input[placeholder="Output"]').prop('value')).toEqual(output)
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment