aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Select.spec.jsx33
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});