From f36f1625f1054d7bfaf2418dc57c20acbd367967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=86=E7=A6=BB?= Date: Tue, 6 Dec 2016 18:42:20 +0800 Subject: [PATCH] add anchor-testing (#4154) * add anchor-testing * recover EOF blank --- tests/anchor/Anchor.test.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/anchor/Anchor.test.js diff --git a/tests/anchor/Anchor.test.js b/tests/anchor/Anchor.test.js new file mode 100644 index 0000000000..a7e857ee46 --- /dev/null +++ b/tests/anchor/Anchor.test.js @@ -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( + + ); + + wrapper.find('a[href="#API"]').simulate('click'); + + wrapper.node.handleScroll(); + expect(wrapper.node.state).not.toBe(null); + }); +});