@@ -127,3 +127,40 @@ TEST_CASES.forEach(({ view, expectedToItemData }) => {
127127 await clearCallbackTesting ( ) ;
128128 } ) ;
129129} ) ;
130+
131+ test ( 'Should not throw error when trying to drag appointment that is being updated with Promise delay (T1308596)' , async ( t ) => {
132+ const scheduler = new Scheduler ( SCHEDULER_SELECTOR ) ;
133+ const appointment = scheduler . getAppointment ( 'Test Appointment' ) ;
134+
135+ await t . drag ( appointment . element , 300 , 0 , { speed : 0.8 } ) ;
136+
137+ await t . wait ( 200 ) ;
138+
139+ await t . drag ( appointment . element , 600 , 0 , { speed : 0.8 } ) ;
140+
141+ await t . wait ( 2000 ) ;
142+
143+ const consoleMessages = await t . getBrowserConsoleMessages ( ) ;
144+ const hasErrors = consoleMessages ?. error && consoleMessages . error . length > 0 ;
145+
146+ await t . expect ( hasErrors ) . notOk ( ) ;
147+ } ) . before ( async ( ) => {
148+ await createWidget ( 'dxScheduler' , {
149+ dataSource : [ {
150+ text : 'Test Appointment' ,
151+ startDate : new Date ( 2023 , 0 , 2 , 10 , 0 ) ,
152+ endDate : new Date ( 2023 , 0 , 2 , 11 , 0 ) ,
153+ } ] ,
154+ views : [ 'week' ] ,
155+ currentView : 'week' ,
156+ currentDate : new Date ( 2023 , 0 , 2 ) ,
157+ height : 600 ,
158+ onAppointmentUpdating : ( e ) => {
159+ e . cancel = new Promise ( ( resolve ) => {
160+ setTimeout ( ( ) => {
161+ resolve ( false ) ;
162+ } , 5000 ) ;
163+ } ) ;
164+ } ,
165+ } ) ;
166+ } ) ;
0 commit comments