What is the reason for .find
not being recognized as a function in the code snippet below?
import React from 'react';
import { shallow } from 'enzyme';
import toJson from 'enzyme-to-json';
import { AuthorizedRoutesJest } from './AuthorizedRoutes';
// Components
import {
Main
} from '../../components';
const wrapper = shallow(<AuthorizedRoutesJest />);
describe('<AuthorizedRoutes /> component', () => {
it('should render', () => {
const tree = toJson(wrapper);
expect(tree).toMatchSnapshot();
expect(wrapper).toHaveLength(1);
});
it('should contain a Main component', () => {
expect(wrapper).find(Main).toHaveLength(1);
});
});
Summary of all failing tests FAIL client/containers/Routes/AuthorizedRoutes.test.js
AuthorizedRoutes component › should contain a Main component
TypeError: expect(...).find is not a function