File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
packages/devextreme/js/__internal/scheduler Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ interface CreateAppointmentPopupOptions {
6161 firstDayOfWeek ?: number ;
6262 startDayHour ?: number ;
6363 onAppointmentFormOpening ?: ( ...args : unknown [ ] ) => void ;
64- onSave ?: jest . Mock ;
64+ onSave ?: jest . Mock < ( appointment : Record < string , unknown > ) => PromiseLike < unknown > > ;
6565 title ?: string ;
6666 readOnly ?: boolean ;
6767 addAppointment ?: jest . Mock ;
@@ -78,7 +78,7 @@ interface CreateAppointmentPopupResult {
7878 updateAppointment : jest . Mock ;
7979 focus : jest . Mock ;
8080 updateScrollPosition : jest . Mock ;
81- onSave : jest . Mock ;
81+ onSave : jest . Mock < ( appointment : Record < string , unknown > ) => PromiseLike < unknown > > ;
8282 } ;
8383 dispose : ( ) => void ;
8484}
@@ -113,7 +113,8 @@ export const createAppointmentPopup = async (
113113 ?? jest . fn ( resolvedDeferred ) ;
114114 const focus = jest . fn ( ) ;
115115 const updateScrollPosition = jest . fn ( ) ;
116- const onSave = options . onSave ?? jest . fn ( resolvedDeferred ) ;
116+ const onSave = options . onSave
117+ ?? jest . fn < ( appointment : Record < string , unknown > ) => PromiseLike < unknown > > ( resolvedDeferred ) ;
117118
118119 const formSchedulerProxy = {
119120 getResourceById : ( ) : Record < string , unknown > => resourceManager . resourceById ,
Original file line number Diff line number Diff line change @@ -116,12 +116,14 @@ describe('Isolated AppointmentPopup environment', () => {
116116
117117 it ( 'should support composite onSave for exclude-from-series scenario' , async ( ) => {
118118 const updateAppointment = jest . fn ( ) ;
119- const addAppointment = jest . fn ( ( ) => Promise . resolve ( ) ) ;
119+ const addAppointment = jest . fn < ( appointment : Record < string , unknown > ) => Promise < void > > (
120+ ( ) => Promise . resolve ( ) ,
121+ ) ;
120122
121123 const sourceAppointment = { text : 'Series' , recurrenceRule : 'FREQ=DAILY' } ;
122124 const updatedAppointment = { text : 'Series' , recurrenceException : '20210426' } ;
123125
124- const onSave = jest . fn ( ( newAppointment ) => {
126+ const onSave = jest . fn ( ( newAppointment : Record < string , unknown > ) => {
125127 updateAppointment ( sourceAppointment , updatedAppointment ) ;
126128 return addAppointment ( newAppointment ) ;
127129 } ) ;
You can’t perform that action at this time.
0 commit comments