ant-design/components/anchor/__tests__/Anchor.test.js

21 lines
449 B
JavaScript
Raw Normal View History

2016-12-14 14:48:09 +08:00
import React from 'react';
import { mount } from 'enzyme';
import Anchor from '..';
const { Link } = Anchor;
describe('Anchor Render', () => {
it('Anchor render perfectly', () => {
const wrapper = mount(
<Anchor>
<Link href="#API" title="API" />
</Anchor>
);
wrapper.find('a[href="#API"]').simulate('click');
2017-09-20 16:26:18 +08:00
wrapper.instance().handleScroll();
expect(wrapper.instance().state).not.toBe(null);
2016-12-14 14:48:09 +08:00
});
});