diff options
author | caojunchao <caojunchao@didichuxing.com> | 2017-03-09 14:22:01 +0800 |
---|---|---|
committer | caojunchao <caojunchao@didichuxing.com> | 2017-03-09 14:22:01 +0800 |
commit | 17444974eff819b0a5c29ae7d5f37242bf407f89 (patch) | |
tree | 5a0288be6e5059eaaf49ccdb6d6d50536f9ec76e /tests | |
parent | d093074a00881b60b3440a35503f0143612143a0 (diff) | |
download | time-picker-17444974eff819b0a5c29ae7d5f37242bf407f89.tar.gz time-picker-17444974eff819b0a5c29ae7d5f37242bf407f89.tar.zst time-picker-17444974eff819b0a5c29ae7d5f37242bf407f89.zip |
Add test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Select.spec.jsx | 28 |
1 files changed, 28 insertions, 0 deletions
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', () => { | |||
33 | document.body.removeChild(container); | 33 | document.body.removeChild(container); |
34 | }); | 34 | }); |
35 | 35 | ||
36 | describe('select panel', () => { | ||
37 | it('select panel reacts to mouseenter and mouseleave correctly', (done) => { | ||
38 | const picker = renderPicker(); | ||
39 | const input = TestUtils.scryRenderedDOMComponentsWithClass(picker, | ||
40 | 'rc-time-picker-input')[0]; | ||
41 | async.series([(next) => { | ||
42 | Simulate.click(input); | ||
43 | setTimeout(next, 100); | ||
44 | }, (next) => { | ||
45 | const re = /(^|\s+)rc-time-picker-panel-select-active(\s+|$)/; | ||
46 | const selector = TestUtils.scryRenderedDOMComponentsWithClass(picker.panelInstance, | ||
47 | 'rc-time-picker-panel-select')[0]; | ||
48 | |||
49 | expect(re.test(selector.className)).to.be(false); | ||
50 | |||
51 | Simulate.mouseEnter(selector); | ||
52 | expect(re.test(selector.className)).to.be(true); | ||
53 | |||
54 | Simulate.mouseLeave(selector); | ||
55 | expect(re.test(selector.className)).to.be(false); | ||
56 | |||
57 | next(); | ||
58 | }], () => { | ||
59 | done(); | ||
60 | }); | ||
61 | }); | ||
62 | }); | ||
63 | |||
36 | describe('select number', () => { | 64 | describe('select number', () => { |
37 | it('select number correctly', (done) => { | 65 | it('select number correctly', (done) => { |
38 | const picker = renderPicker(); | 66 | const picker = renderPicker(); |