diff options
author | Antony Shaleynikov <shaleynikov@gmail.com> | 2017-03-02 16:20:29 +0300 |
---|---|---|
committer | Antony Shaleynikov <shaleynikov@gmail.com> | 2017-03-02 16:20:29 +0300 |
commit | 0328afec8ec844b7f8c948f0434a1021d9c11033 (patch) | |
tree | cba4418d6c4abe439e0082f87fd2c4ffc3844e94 /tests | |
parent | 35949690d0c5bada9a86fc67a9ee04c96d9a8b15 (diff) | |
download | time-picker-0328afec8ec844b7f8c948f0434a1021d9c11033.tar.gz time-picker-0328afec8ec844b7f8c948f0434a1021d9c11033.tar.zst time-picker-0328afec8ec844b7f8c948f0434a1021d9c11033.zip |
Added more tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Select.spec.jsx | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/Select.spec.jsx b/tests/Select.spec.jsx index fe20178..827a736 100644 --- a/tests/Select.spec.jsx +++ b/tests/Select.spec.jsx | |||
@@ -413,5 +413,38 @@ describe('Select', () => { | |||
413 | done(); | 413 | done(); |
414 | }); | 414 | }); |
415 | }); | 415 | }); |
416 | |||
417 | |||
418 | it('renders 12am/pm correctly', (done) => { | ||
419 | const picker = renderPicker({ | ||
420 | use12Hours: true, | ||
421 | defaultValue: moment().hour(0).minute(0).second(0), | ||
422 | showSecond: false, | ||
423 | format: undefined, | ||
424 | }); | ||
425 | expect(picker.state.open).not.to.be.ok(); | ||
426 | const input = TestUtils.scryRenderedDOMComponentsWithClass(picker, | ||
427 | 'rc-time-picker-input')[0]; | ||
428 | let selector; | ||
429 | async.series([(next) => { | ||
430 | expect(picker.state.open).to.be(false); | ||
431 | |||
432 | Simulate.click(input); | ||
433 | setTimeout(next, 100); | ||
434 | }, (next) => { | ||
435 | expect(picker.state.open).to.be(true); | ||
436 | selector = TestUtils.scryRenderedDOMComponentsWithClass(picker.panelInstance, | ||
437 | 'rc-time-picker-panel-select')[2]; | ||
438 | expect((input).value).to.be('12:00 am'); | ||
439 | const option = selector.getElementsByTagName('li')[1]; | ||
440 | Simulate.click(option); | ||
441 | setTimeout(next, 100); | ||
442 | }, (next) => { | ||
443 | expect((input).value).to.be('12:00 pm'); | ||
444 | next(); | ||
445 | }], () => { | ||
446 | done(); | ||
447 | }); | ||
448 | }); | ||
416 | }); | 449 | }); |
417 | }); | 450 | }); |