ReactJS
1import React from "react";
2import Enzyme, {shallow} from 'enzyme';
3import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
4import {Dropdown} from "../Dropdown";
5
6Enzyme.configure({adapter: new Adapter()});
7
8describe('Dropdown', () => {
9test('Should render', () => {
10const wrapper = shallow(<Dropdown children={<div/>} button={<button/>}/>);
11expect(wrapper).toBeDefined();
12expect(wrapper.find('button').isEmptyRender()).toBeFalsy();
13})
14
15test('should render(snapshot)', () => {
16const wrapper = shallow(<Dropdown children={<div/>} button={<button/>}/>);
17expect(wrapper).toMatchSnapshot();
18})
19})