From: caojunchao Date: Thu, 9 Mar 2017 06:22:01 +0000 (+0800) Subject: Add test X-Git-Tag: 2.3.2~1^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=17444974eff819b0a5c29ae7d5f37242bf407f89;p=github%2Ffretlink%2Ftime-picker.git Add test --- 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();