aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
author偏右 <afc163@gmail.com>2017-10-22 16:38:04 +0800
committerGitHub <noreply@github.com>2017-10-22 16:38:04 +0800
commitf0ac29c61df164ab3e867ef86137faa13d85a87f (patch)
tree6b1baa2373001870fa00310da36d46b21e8a43c8 /tests
parentcc2dca8a2bb0bf3b820903043be2586fb413c458 (diff)
parent8a116e355bfabda48537be06d21cf01fdceaa8b7 (diff)
downloadtime-picker-f0ac29c61df164ab3e867ef86137faa13d85a87f.tar.gz
time-picker-f0ac29c61df164ab3e867ef86137faa13d85a87f.tar.zst
time-picker-f0ac29c61df164ab3e867ef86137faa13d85a87f.zip
Merge branch 'master' into picker-step
Diffstat (limited to 'tests')
-rw-r--r--tests/Header.spec.jsx28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/Header.spec.jsx b/tests/Header.spec.jsx
index 5ab0ba0..4b27abb 100644
--- a/tests/Header.spec.jsx
+++ b/tests/Header.spec.jsx
@@ -368,5 +368,33 @@ describe('Header', () => {
368 done(); 368 done();
369 }); 369 });
370 }); 370 });
371
372 it('focus on open', (done) => {
373 const picker = renderPicker({
374 focusOnOpen: true,
375 });
376 expect(picker.state.open).not.to.be.ok();
377 const input = TestUtils.scryRenderedDOMComponentsWithClass(picker,
378 'rc-time-picker-input')[0];
379 let header;
380 async.series([(next) => {
381 expect(picker.state.open).to.be(false);
382
383 Simulate.click(input);
384 setTimeout(next, 100);
385 }, (next) => {
386 // this touches the focusOnOpen code, but we cannot verify the input is in focus
387 expect(picker.state.open).to.be(true);
388 header = TestUtils.scryRenderedDOMComponentsWithClass(picker.panelInstance,
389 'rc-time-picker-panel-input')[0];
390 expect(header).to.be.ok();
391 expect((header).value).to.be('01:02:03');
392 expect((input).value).to.be('01:02:03');
393
394 next();
395 }], () => {
396 done();
397 });
398 });
371 }); 399 });
372}); 400});