From 17444974eff819b0a5c29ae7d5f37242bf407f89 Mon Sep 17 00:00:00 2001 From: caojunchao Date: Thu, 9 Mar 2017 14:22:01 +0800 Subject: Add test --- tests/Select.spec.jsx | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tests') diff --git a/tests/Select.spec.jsx b/tests/Select.spec.jsx index fd2ec32..2d30098 100644 --- a/tests/Select.spec.jsx +++ b/tests/Select.spec.jsx @@ -33,6 +33,34 @@ describe('Select', () => { document.body.removeChild(container); }); + describe('select panel', () => { + it('select panel reacts to mouseenter and mouseleave correctly', (done) => { + const picker = renderPicker(); + const input = TestUtils.scryRenderedDOMComponentsWithClass(picker, + 'rc-time-picker-input')[0]; + async.series([(next) => { + Simulate.click(input); + setTimeout(next, 100); + }, (next) => { + const re = /(^|\s+)rc-time-picker-panel-select-active(\s+|$)/; + const selector = TestUtils.scryRenderedDOMComponentsWithClass(picker.panelInstance, + 'rc-time-picker-panel-select')[0]; + + expect(re.test(selector.className)).to.be(false); + + Simulate.mouseEnter(selector); + expect(re.test(selector.className)).to.be(true); + + Simulate.mouseLeave(selector); + expect(re.test(selector.className)).to.be(false); + + next(); + }], () => { + done(); + }); + }); + }); + describe('select number', () => { it('select number correctly', (done) => { const picker = renderPicker(); -- cgit v1.2.3