Skip to content

Instantly share code, notes, and snippets.

@sseletskyy
Created December 30, 2016 11:48
Show Gist options
  • Save sseletskyy/a89da0f621ae4374cfb4de7266d8a42a to your computer and use it in GitHub Desktop.
Save sseletskyy/a89da0f621ae4374cfb4de7266d8a42a to your computer and use it in GitHub Desktop.
React Container Test
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