import React from 'react'; import { mount } from 'enzyme'; import Anchor from '..'; const { Link } = Anchor; describe('Anchor Render', () => { it('Anchor render perfectly', () => { const wrapper = mount( ); wrapper.find('a[href="#API"]').simulate('click'); wrapper.instance().handleScroll(); expect(wrapper.instance().state).not.toBe(null); }); });