@@ -80,7 +80,6 @@ describe('ExpandableCalendar', () => {
8080 } ) ;
8181
8282 describe ( 'Init' , ( ) => {
83-
8483 beforeEach ( ( ) => {
8584 driver . render ( ) ;
8685 } ) ;
@@ -126,15 +125,38 @@ describe('ExpandableCalendar', () => {
126125 } ) ;
127126
128127 it ( 'should not close expandable header on day press when closeOnDayPress is false' , ( ) => {
129- const aDriver = new ExpandableCalendarDriver ( testIdExpandableCalendar , TestCase ( { expandableCalendarProps : { closeOnDayPress : false } } ) ) ;
130- aDriver . toggleKnob ( ) ;
128+ const driver = new ExpandableCalendarDriver ( testIdExpandableCalendar , TestCase ( { expandableCalendarProps : { closeOnDayPress : false } } ) ) ;
129+ driver . toggleKnob ( ) ;
131130 jest . runAllTimers ( ) ;
132- aDriver . selectDay ( dashedToday ) ;
131+ driver . selectDay ( dashedToday ) ;
132+ jest . runAllTimers ( ) ;
133+ expect ( driver . isCalendarExpanded ( ) ) . toBe ( true ) ;
134+ } ) ;
135+ } ) ;
136+
137+ describe ( 'numberOfDays' , ( ) => {
138+ beforeEach ( ( ) => {
139+ driver . render ( ) ;
140+ } ) ;
141+
142+ it ( 'should be closed when numberOfDays is defined (> 0) ' , ( ) => {
143+ const driver = new ExpandableCalendarDriver ( testIdExpandableCalendar , TestCase ( { calendarContextProps : { numberOfDays : 3 } , expandableCalendarProps : { initialPosition : Positions . OPEN } } ) ) ;
133144 jest . runAllTimers ( ) ;
134- expect ( aDriver . isCalendarExpanded ( ) ) . toBe ( true ) ;
145+ expect ( driver . isCalendarExpanded ( ) ) . toBe ( false ) ;
146+ } ) ;
147+
148+ it ( 'should hide Knob when numberOfDays > 1' , ( ) => {
149+ const driver = new ExpandableCalendarDriver ( testIdExpandableCalendar , TestCase ( { calendarContextProps : { numberOfDays : 3 } } ) ) ;
150+ expect ( driver . getKnob ( ) ) . toBeNull ( ) ;
151+ } ) ;
152+
153+ it ( 'should hide Knob when numberOfDays === 1' , ( ) => {
154+ const driver = new ExpandableCalendarDriver ( testIdExpandableCalendar , TestCase ( { calendarContextProps : { numberOfDays : 1 } } ) ) ;
155+ expect ( driver . getKnob ( ) ) . not . toBeNull ( ) ;
135156 } ) ;
136157 } ) ;
137158
159+
138160 describe ( 'CalendarList updates' , ( ) => {
139161 describe ( 'Day Press' , ( ) => {
140162 beforeEach ( ( ) => {
0 commit comments