File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4491,6 +4491,21 @@ describe("DatePicker", () => {
44914491 expect ( firstDay ?. textContent ) . toBe ( "Su" ) ;
44924492 } ) ;
44934493
4494+ it ( "should correctly format weekday using formatWeekDay prop" , ( ) => {
4495+ const { container } = render (
4496+ < DatePicker formatWeekDay = { ( day ) => day . charAt ( 0 ) } /> ,
4497+ ) ;
4498+ const input = safeQuerySelector ( container , "input" ) ;
4499+ fireEvent . focus ( input ) ;
4500+
4501+ const dayNames = container . querySelectorAll (
4502+ ".react-datepicker__day-names > div[role='columnheader'] > span[aria-hidden='true']" ,
4503+ ) ;
4504+ dayNames . forEach ( ( dayName ) => {
4505+ expect ( dayName . textContent ) . toHaveLength ( 1 ) ;
4506+ } ) ;
4507+ } ) ;
4508+
44944509 describe ( "when update the datepicker input text while props.showTimeSelectOnly is set and dateFormat has only time related format" , ( ) => {
44954510 const format = "h:mm aa" ;
44964511
You can’t perform that action at this time.
0 commit comments