@@ -151,7 +151,7 @@ describe('Test drag\'n\'drop related actions', () => {
151151    expect ( ( app . emitted ( 'input' )  as  any ) [ 0 ] [ 0 ] ) . toStrictEqual ( qbClone ) ; 
152152  } ) ; 
153153
154-   it ( 'tests drag\'n\'drop by merging with a parent group' ,  async   done  =>  { 
154+   it ( 'tests drag\'n\'drop by merging with a parent group' ,  done  =>  { 
155155    const  app  =  mount ( QueryBuilder ,  { 
156156      propsData : { 
157157        value, 
@@ -204,15 +204,16 @@ describe('Test drag\'n\'drop related actions', () => {
204204    } ; 
205205    adderComponent . findComponent ( Draggable ) . vm . $emit ( 'change' ,  addEv ) ; 
206206
207-     await  flushPromises ( ) ; 
207+     flushPromises ( ) 
208+       . then ( ( )  =>  { 
209+         expect ( ( parent . emitted ( 'query-update' )  as  any ) [ 0 ] [ 0 ] ) . toStrictEqual ( qbClone ) ; 
210+         expect ( ( app . emitted ( 'input' )  as  any ) [ 0 ] [ 0 ] ) . toStrictEqual ( qbClone ) ; 
208211
209-     expect ( ( parent . emitted ( 'query-update' )  as  any ) [ 0 ] [ 0 ] ) . toStrictEqual ( qbClone ) ; 
210-     expect ( ( app . emitted ( 'input' )  as  any ) [ 0 ] [ 0 ] ) . toStrictEqual ( qbClone ) ; 
211- 
212-     done ( ) ; 
212+         done ( ) ; 
213+       } ) ; 
213214  } ) ; 
214215
215-   it ( 'tests drag\'n\'dropping with merging within the adding group' ,  async   done  =>  { 
216+   it ( 'tests drag\'n\'dropping with merging within the adding group' ,  done  =>  { 
216217    const  app  =  mount ( QueryBuilder ,  { 
217218      propsData : { 
218219        value, 
@@ -263,15 +264,16 @@ describe('Test drag\'n\'drop related actions', () => {
263264    } ; 
264265    adderComponent . findComponent ( Draggable ) . vm . $emit ( 'change' ,  addEv ) ; 
265266
266-     await   flushPromises ( ) ; 
267- 
268-     expect ( ( adderComponent . emitted ( 'query-update' )  as  any ) [ 0 ] [ 0 ] ) . toStrictEqual ( adder ) ; 
269-     expect ( ( app . emitted ( 'input' )  as  any ) [ 0 ] [ 0 ] ) . toStrictEqual ( qbClone ) ; 
267+     flushPromises ( ) 
268+        . then ( ( )   =>   { 
269+          expect ( ( adderComponent . emitted ( 'query-update' )  as  any ) [ 0 ] [ 0 ] ) . toStrictEqual ( adder ) ; 
270+          expect ( ( app . emitted ( 'input' )  as  any ) [ 0 ] [ 0 ] ) . toStrictEqual ( qbClone ) ; 
270271
271-     done ( ) ; 
272+         done ( ) ; 
273+       } ) ; 
272274  } ) ; 
273275
274-   it ( 'tests drag\'n\'dropping with merging within the deleting group' ,  async   done  =>  { 
276+   it ( 'tests drag\'n\'dropping with merging within the deleting group' ,  done  =>  { 
275277    const  app  =  mount ( QueryBuilder ,  { 
276278      propsData : { 
277279        value, 
@@ -322,11 +324,13 @@ describe('Test drag\'n\'drop related actions', () => {
322324    } ; 
323325    adderComponent . findComponent ( Draggable ) . vm . $emit ( 'change' ,  addEv ) ; 
324326
325-     await  flushPromises ( ) ; 
326- 
327-     expect ( ( removerComponent . emitted ( 'query-update' )  as  any ) [ 0 ] [ 0 ] ) . toStrictEqual ( remover ) ; 
328-     expect ( ( app . emitted ( 'input' )  as  any ) [ 0 ] [ 0 ] ) . toStrictEqual ( qbClone ) ; 
327+     // await flushPromises(); 
328+     flushPromises ( ) 
329+       . then ( ( )  =>  { 
330+         expect ( ( removerComponent . emitted ( 'query-update' )  as  any ) [ 0 ] [ 0 ] ) . toStrictEqual ( remover ) ; 
331+         expect ( ( app . emitted ( 'input' )  as  any ) [ 0 ] [ 0 ] ) . toStrictEqual ( qbClone ) ; 
329332
330-     done ( ) ; 
333+         done ( ) ; 
334+       } ) ; 
331335  } ) ; 
332336} ) ; 
0 commit comments