Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Testing Foo interaction using jest + enzyme + enzyme-to-json
'use strict';
const Foo = require('../Foo');
const React = require('react');
import { mount } from 'enzyme';
import { mountToJson } from 'enzyme-to-json';
describe('Foo', () => {
it('simulate a change event using enzyme', () => {
const wrapper = mount(<Foo />);
const input = wrapper.find('input');
input.node.value = 'this is a new value';
input.simulate('change', input);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.