'mount is not working in enzyam in react js
//write the test case got this error when i am using shallow its working fine but not gent expect value do you have any solutin please help to me
import React from "react";
import Organization from "./Organization";
import { shallow, mount } from "enzyme";
import store from "../../redux/store";
import { Provider } from "react-redux";
describe("Organization", () => {
it("Organization render", () => {
const wrapper = mount(
<Provider store={store}>
<Organization />
</Provider>
);
expect(wrapper.find("Organization").length).toBe(1);
});
});
TypeError: Cannot read properties of undefined (reading 'child')
7 | describe("Organization", () => {
8 | it("Organization render", () => {
> 9 | const wrapper = mount(
| ^
10 | <Provider store={store}>
11 | <Organization />
12 | </Provider>
i don't know why this error
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|