Top "Enzyme" questions

Unit test library for React.

Jest enzyme shallow unexpected token <

I am trying to use enzyme for testing react components, but cant get started even with the most basic example. …

reactjs jestjs enzyme
How can I test React component's style with Jest + Enzyme?

Alright I have a component called <TestButton />. Inside the <TestButton /> there are two Semantic UI React …

javascript reactjs enzyme jestjs semantic-ui-react
React + enzyme unit tests, can't access window.addEventListener

I have some unit tests set up, testing with enzyme's shallow method with a jsdom configuration. This has been working …

javascript reactjs unit-testing enzyme jsdom
How to mock/spy useState hook in jest?

I am trying to spy on useState React hook but i always get the test failed This is my React …

javascript reactjs testing enzyme jes
How to print the contents of enzyme's shallow wrapper

I have the following : how do I see the contents of wrapper?

javascript reactjs enzyme
Enzyme Test React.createRef()

I have a commponent where I use the new React.createRef() api, how to test document.activeElement should be equal …

javascript reactjs jestjs enzyme chai-enzyme
How test a component using the useReducer hook?

Reducer // src/reducers/FooReducer.js export function FooReducer(state, action) { switch (action.type) { case 'update': { return action.newState; } // ... other actions …

reactjs react-hooks enzyme react-hooks-testing-library
How does one access state on a nested React component wrapped by an HOC?

I'm using Enzyme, and we can actually use the example component given in the docs as a foundation for my …

react-router jestjs enzyme react-router-v4
Files upload testing in Enzyme

I have a FileInput in my render function <FileInput accept= "image/jpeg,image/png,audio/mp3" onChange= {this.fileInputOnChange} …

reactjs mocha sinon chai enzyme
Unit testing a formik component with jest/enzyme

I've put together a pretty basic contact form that works just fine. However I now need to start writing my …

javascript reactjs jestjs enzyme formik