add anchor-testing (#4154)

* add anchor-testing

* recover EOF blank
This commit is contained in:
陆离 2016-12-06 18:42:20 +08:00 committed by Wei Zhu
parent bd1334065d
commit f36f1625f1

View File

@ -0,0 +1,17 @@
import React from 'react';
import { mount } from 'enzyme';
import Anchor from '../../components/anchor';
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');
wrapper.node.handleScroll();
expect(wrapper.node.state).not.toBe(null);
});
});