'component props not getting called on test cases

TypeError: Cannot read property 'setState' of null

  251 |     useStateSpy.mockImplementation((init) => [init, setState]);
  252 |     const component = shallow(<EditDetails {...props} />);
> 253 |     component.instance().setState({ LoyaltyNumberStatus });
      |     ^
  254 |     expect(component.text()).toMatchSnapshot();
  255 |   });
  256 |   it('should render EditDetails Loyalty Input data', () => {


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source