Created
December 30, 2016 11:48
-
-
Save sseletskyy/a89da0f621ae4374cfb4de7266d8a42a to your computer and use it in GitHub Desktop.
React Container Test
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 expect from 'expect'; | |
import {shallow, mount} from 'enzyme' | |
import {$NAME} from './$NAME' | |
describe('<$NAME />', ()=>{ | |
function setup() { | |
let props = { | |
actions: { someAction: () => Promise.resolve() } | |
}; | |
return mount(<$NAME {...props} />) | |
} | |
it('should work', ()=>{ | |
const wrapper = setup(); | |
const btn = wrapper.find('input').last(); | |
expect(btn.prop('type').toBe('submit'); | |
btn.simulate('click'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment