diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Select.spec.jsx | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/Select.spec.jsx b/tests/Select.spec.jsx index ea0a827..fd2ec32 100644 --- a/tests/Select.spec.jsx +++ b/tests/Select.spec.jsx | |||
@@ -452,5 +452,43 @@ describe('Select', () => { | |||
452 | done(); | 452 | done(); |
453 | }); | 453 | }); |
454 | }); | 454 | }); |
455 | |||
456 | it('renders uppercase AM correctly', (done) => { | ||
457 | const picker = renderPicker({ | ||
458 | use12Hours: true, | ||
459 | defaultValue: moment().hour(0).minute(0).second(0), | ||
460 | showSecond: false, | ||
461 | format: 'h:mm A', | ||
462 | }); | ||
463 | expect(picker.state.open).not.to.be.ok(); | ||
464 | const input = TestUtils.scryRenderedDOMComponentsWithClass(picker, | ||
465 | 'rc-time-picker-input')[0]; | ||
466 | let selector; | ||
467 | async.series([(next) => { | ||
468 | expect(picker.state.open).to.be(false); | ||
469 | |||
470 | Simulate.click(input); | ||
471 | setTimeout(next, 100); | ||
472 | }, (next) => { | ||
473 | expect(picker.state.open).to.be(true); | ||
474 | selector = TestUtils.scryRenderedDOMComponentsWithClass(picker.panelInstance, | ||
475 | 'rc-time-picker-panel-select')[2]; | ||
476 | expect((input).value).to.be('12:00 AM'); | ||
477 | const option = selector.getElementsByTagName('li')[1]; | ||
478 | Simulate.click(option); | ||
479 | setTimeout(next, 200); | ||
480 | }, (next) => { | ||
481 | expect((input).value).to.be('12:00 PM'); | ||
482 | next(); | ||
483 | }, (next) => { | ||
484 | Simulate.click(selector.getElementsByTagName('li')[0]); | ||
485 | setTimeout(next, 200); | ||
486 | }, (next) => { | ||
487 | expect((input).value).to.be('12:00 AM'); | ||
488 | next(); | ||
489 | }], () => { | ||
490 | done(); | ||
491 | }); | ||
492 | }); | ||
455 | }); | 493 | }); |
456 | }); | 494 | }); |