Top "Enzyme" questions

Unit test library for React.

Test setting text value with React and Enzyme

How do you set the text of a text input and then test it's value with React / Enzyme? const input = …

javascript reactjs testing enzyme
How to set initial state for useState Hook in jest and enzyme?

Currently Im using functional component with react hooks. But I'm unable to test the useState hook completely. Consider a scenario …

javascript reactjs enzyme react-hooks react-hooks-testing-library
Testing input.focus() in Enzyme

Can anyone help me to test input.focus() in enzyme.I am writing the script with react.My code is …

reactjs typescript enzyme
Jest + Enzyme: How to test an image src?

I have a Logo component: import React from "react"; import logo from "assets/images/logo.png"; const Logo = () => { return &…

reactjs jestjs enzyme
How to mock e.preventDefault in react component's child

Hy, I don't know how to mock an inline function in React component's child My stack: sinon, chai, enzyme; Component …

unit-testing reactjs mocha sinon enzyme
Jest: mocking console.error - tests fails

The Problem: I have a simple React component I'm using to learn to test components with Jest and Enzyme. As …

javascript reactjs jestjs enzyme
Check if child component rendered - Jest, Enzyme

In my unit test, I want to test whether the parent component is successfully rendering its child component. Here is …

javascript reactjs unit-testing jestjs enzyme
How to test react-router with enzyme

I am using enzyme+mocha+chai to test my react-redux project. Enzyme provides shallow to test component behavior. But I …

reactjs mocha react-router chai enzyme
TypeError: Cannot assign to read only property 'x' of object '#<Object>' React/JEST

While I am writing test case for my react component I am getting TypeError: Cannot assign to read only property …

reactjs jestjs enzyme babel-jest
Is there an option to show all test descriptions when I run jest tests?

I'm using jest and enzyme with my create-react-app project. When I run npm test, I get an output that shows …

reactjs jestjs enzyme create-react-app