File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -162,10 +162,15 @@ describe("Calendar", function () {
162162 } ) ;
163163
164164 it ( "should correctly format weekday using formatWeekDay prop" , function ( ) {
165- const calendar = getCalendar ( { formatWeekDay : ( day ) => day [ 0 ] } ) ;
165+ const mockFormattedWeekDay = "mockFormattedWeekDay" ;
166+ const formatWeekDay = sinon . fake . returns ( mockFormattedWeekDay ) ;
167+ const calendar = getCalendar ( { formatWeekDay } ) ;
168+ sinon . assert . alwaysCalledWith ( formatWeekDay , sinon . match . date ) ;
166169 calendar
167170 . find ( ".react-datepicker__day-name" )
168- . forEach ( ( dayName ) => expect ( dayName . text ( ) ) . to . have . length ( 1 ) ) ;
171+ . forEach ( ( dayName ) =>
172+ expect ( dayName . text ( ) ) . to . equals ( mockFormattedWeekDay )
173+ ) ;
169174 } ) ;
170175
171176 it ( "should contain the correct class when using the weekDayClassName prop" , ( ) => {
You can’t perform that action at this time.
0 commit comments