score:0

mount function provides full dom rendering therefore you'll need to set up jsdom in your test setup. you can see more info here:

error: it looks like you called `mount()` without a global document being loaded

another thing is that, you should provide childcontexttypes attribute when you're defining context with mount like this:

mount(<users />, {
    context: { store: mockstore },
    childcontexttypes: { store: proptypes.object }
  }); 

however if you're writing unit test of a react component you should use shallow function provided by enzyme. it just renders the component with one deep level, so that you don't need to create jsdom and provide context parameters when you're creating the wrapper component. mount rendering in a test means you're actually writing an integration test.

const wrapper = shallow(<users />);
wrapper.find(userlistmenu).to.have.length(1);

Related Query

More Query from same tag