@@ -96,8 +96,8 @@ describe('<DeleteWithConfirmButton />', () => {
96
96
97
97
it ( 'should allow to override the resource' , async ( ) => {
98
98
const dataProvider = testDataProvider ( {
99
- // @ts -ignore
100
99
getOne : ( ) =>
100
+ // @ts -ignore
101
101
Promise . resolve ( {
102
102
data : { id : 123 , title : 'lorem' } ,
103
103
} ) ,
@@ -137,8 +137,8 @@ describe('<DeleteWithConfirmButton />', () => {
137
137
138
138
it ( 'should allows to undo the deletion after confirmation if mutationMode is undoable' , async ( ) => {
139
139
const dataProvider = testDataProvider ( {
140
- // @ts -ignore
141
140
getOne : ( ) =>
141
+ // @ts -ignore
142
142
Promise . resolve ( {
143
143
data : { id : 123 , title : 'lorem' } ,
144
144
} ) ,
@@ -182,8 +182,8 @@ describe('<DeleteWithConfirmButton />', () => {
182
182
183
183
it ( 'should allow to override the success side effects' , async ( ) => {
184
184
const dataProvider = testDataProvider ( {
185
- // @ts -ignore
186
185
getOne : ( ) =>
186
+ // @ts -ignore
187
187
Promise . resolve ( {
188
188
data : { id : 123 , title : 'lorem' } ,
189
189
} ) ,
@@ -226,13 +226,17 @@ describe('<DeleteWithConfirmButton />', () => {
226
226
{ snapshot : [ ] }
227
227
) ;
228
228
} ) ;
229
+ await waitFor ( ( ) => {
230
+ // Check that the dialog is closed
231
+ expect ( screen . queryByText ( 'ra.action.confirm' ) ) . toBeNull ( ) ;
232
+ } ) ;
229
233
} ) ;
230
234
231
235
it ( 'should allow to override the error side effects' , async ( ) => {
232
236
jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } ) ;
233
237
const dataProvider = testDataProvider ( {
234
- // @ts -ignore
235
238
getOne : ( ) =>
239
+ // @ts -ignore
236
240
Promise . resolve ( {
237
241
data : { id : 123 , title : 'lorem' } ,
238
242
} ) ,
@@ -275,12 +279,16 @@ describe('<DeleteWithConfirmButton />', () => {
275
279
{ snapshot : [ ] }
276
280
) ;
277
281
} ) ;
282
+ await waitFor ( ( ) => {
283
+ // Check that the dialog is closed
284
+ expect ( screen . queryByText ( 'ra.action.confirm' ) ) . toBeNull ( ) ;
285
+ } ) ;
278
286
} ) ;
279
287
280
288
it ( 'should allow to override the translateOptions props' , async ( ) => {
281
289
const dataProvider = testDataProvider ( {
282
- // @ts -ignore
283
290
getOne : ( ) =>
291
+ // @ts -ignore
284
292
Promise . resolve ( {
285
293
data : { id : 123 , title : 'lorem' } ,
286
294
} ) ,
@@ -322,8 +330,8 @@ describe('<DeleteWithConfirmButton />', () => {
322
330
it ( 'should display success message after successful deletion' , async ( ) => {
323
331
const successMessage = 'Test Message' ;
324
332
const dataProvider = testDataProvider ( {
325
- // @ts -ignore
326
333
getOne : ( ) =>
334
+ // @ts -ignore
327
335
Promise . resolve ( {
328
336
data : { id : 123 , title : 'lorem' } ,
329
337
} ) ,
0 commit comments