React Testing Patterns - a podcast by Kent C. Dodds
from 2017-05-31T15:02:37
I had a friend send me this testing code:
describe('handleChangeStatusConditionSearchText', () =>{
test('should handle changing status search text within FormWizard', () =>{
const wrapper = shallow(
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 (https://github.com/airbnb/enzyme) and shallowrendering (https://github.com/airbnb/enzyme/blob/f3bbfd3c2b1ae5c09d50fa0429d0dd599d3bbe82/docs/api/shallow.md), and then never shallow render again... 😉)
Further episodes of 3 Minutes with Kent
Further podcasts by Kent C. Dodds
Website of Kent C. Dodds