3 Minutes with Kent
3 Minutes with Kent
Kent C. Dodds
React Testing Patterns
2 minutes Posted May 31, 2017 at 3:02 pm.
0:00
2:51
Download MP3
Show notes

I had a friend send me this testing code:

describe('handleChangeStatusConditionSearchText', () => {
test('should handle changing status search text within FormWizard', () =>
{
const wrapper = shallow(<FormWizard />);
const state = {
...wrapper.instance().state,
statusConditionSearchText: 'poop'
};
wrapper.instance().handleChangeStatusConditionSearchText('poop');
expect(wrapper.instance().state).toEqual(state);
});
});

And I had a few concerns with it, so I decided to record my thoughts :)

(Learn more about enzyme and shallow
rendering
, and then never shallow render again... 😉)