@@ -90,6 +90,11 @@ describe("GIVEN a DatePicker where selectionVariant is single", () => {
90
90
cy . findByRole ( "textbox" ) . click ( ) . type ( "{downArrow}" , { force : true } ) ;
91
91
cy . findByRole ( "application" ) . should ( "not.exist" ) ;
92
92
} ) ;
93
+
94
+ it ( "SHOULD not open overlay if defaultOpen is set" , ( ) => {
95
+ cy . mount ( < Single readOnly defaultOpen /> ) ;
96
+ cy . findByRole ( "application" ) . should ( "not.exist" ) ;
97
+ } ) ;
93
98
} ) ;
94
99
95
100
adapters . forEach ( ( adapter : SaltDateAdapter < DateFrameworkType > ) => {
@@ -482,9 +487,7 @@ describe("GIVEN a DatePicker where selectionVariant is single", () => {
482
487
} ) ;
483
488
484
489
it ( "SHOULD be able to enable the overlay to open on click" , ( ) => {
485
- cy . mount (
486
- < UncontrolledOpen openOnClick defaultSelectedDate = { initialDate } /> ,
487
- ) ;
490
+ cy . mount ( < Single openOnClick defaultSelectedDate = { initialDate } /> ) ;
488
491
cy . findByRole ( "application" ) . should ( "not.exist" ) ;
489
492
// Simulate opening the calendar on click
490
493
cy . document ( ) . find ( "input" ) . realClick ( ) ;
@@ -503,12 +506,7 @@ describe("GIVEN a DatePicker where selectionVariant is single", () => {
503
506
} ) ;
504
507
505
508
it ( "SHOULD be able to enable the overlay to open on keydown" , ( ) => {
506
- cy . mount (
507
- < UncontrolledOpen
508
- openOnKeyDown
509
- defaultSelectedDate = { initialDate }
510
- /> ,
511
- ) ;
509
+ cy . mount ( < Single openOnKeyDown defaultSelectedDate = { initialDate } /> ) ;
512
510
cy . findByRole ( "application" ) . should ( "not.exist" ) ;
513
511
// Simulate opening the calendar on arrow down
514
512
cy . document ( ) . find ( "input" ) . realClick ( ) ;
@@ -529,9 +527,7 @@ describe("GIVEN a DatePicker where selectionVariant is single", () => {
529
527
} ) ;
530
528
531
529
it ( "SHOULD be able to enable the overlay to open on focus" , ( ) => {
532
- cy . mount (
533
- < UncontrolledOpen openOnFocus defaultSelectedDate = { initialDate } /> ,
534
- ) ;
530
+ cy . mount ( < Single openOnFocus defaultSelectedDate = { initialDate } /> ) ;
535
531
cy . findByRole ( "application" ) . should ( "not.exist" ) ;
536
532
// Simulate opening the calendar on focus
537
533
cy . document ( ) . find ( "input" ) . focus ( ) ;
0 commit comments