Top "Enzyme" questions

Unit test library for React.

Testing React Functional Component with Hooks using Jest

So I'm moving away from class based components to functional components but am stuck while writing test with jest/enzyme …

reactjs typescript jestjs enzyme react-hooks
How do I get an attribute of an element nested in a React component using Jest and/or Enzyme?

I want to test to see whether an image has properly loaded in a React app. I have decided to …

javascript reactjs jestjs enzyme
jest + enzyme, using mount(), document.getElementById() returns null on component which appear after _method call

I faced a problem with my jest+enzyme mount() testing. I am testing a function, which switches displaying components. Switch …

reactjs testing jestjs enzyme mount
Figuring out how to mock the window size changing for a react component test

So basically when the component mounts, I have an event listener listen for resize events. It toggles the isMobileView state …

javascript reactjs unit-testing jestjs enzyme
Test if function is called react and enzyme

I am trying to test one of the methods in my react component. It is being called after a button …

reactjs sinon enzyme
React enzyme testing, Cannot read property 'have' of undefined

I'm writing a test using Enzyme for React. My test is extremely straightforward: import OffCanvasMenu from '../index'; import { Link } …

testing reactjs enzyme
Enzyme expects an adapter to be configured

I created a new React application by create-react-app and I wanted to write a unit test to a component named "…

reactjs enzyme create-react-app
Set state when testing functional component with useState() hook

When I tested class component with enzyme I could do wrapper.setState({}) to set state. How can I do the …

reactjs enzyme setstate react-hooks
How to test child component method with Enzyme?

I have a component like that: <Parent> <Child/> </Parent> and <Child/> component …

javascript reactjs react-router enzyme
how to check the actual DOM node using react enzyme

Is there a way to get the actual DOM node so I can the query it with the Dom api …

javascript dom reactjs enzyme