Файл с тестом:
import React from "react";
import DataAdmin from "../../../src/components/data-admin/DataAdmin";
import { configure, shallow } from "enzyme";
import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter() });
it("should render DataAdmin component", () => {
const component = shallow(<DataAdmin />);
const dataTable = component.find("DataTable");
expect(dataTable.length).toBe(1);
});
Ошибка:
Фрагмент компонента:
const DataAdmin = () => {
const {
preparedEvents,
dropdownItems,
dropdownClicked, setDropdownClicked,
loading,
updatedChanges, setUpdatedChanges
} = useContext(EventsLoadingContext);