66 privateClient ,
77 publicClient ,
88 anonymousClient ,
9+ waitForDumpProcessing ,
910} from './meilisearch-test-utils'
1011
1112beforeAll ( async ( ) => {
@@ -17,18 +18,18 @@ describe.each([
1718 { client : privateClient , permission : 'Private' } ,
1819] ) ( 'Test on dump' , ( { client, permission } ) => {
1920 test ( `${ permission } key: create a new dump` , async ( ) => {
20- await client . createDump ( ) . then ( ( response ) => {
21- expect ( response . uid ) . toBeDefined ( )
22- expect ( response . status ) . toEqual ( 'in_progress' )
23- } )
21+ const response = await client . createDump ( )
22+ expect ( response . uid ) . toBeDefined ( )
23+ expect ( response . status ) . toEqual ( 'in_progress' )
24+ await waitForDumpProcessing ( response . uid , client )
2425 } )
2526
2627 test ( `${ permission } key: get dump status` , async ( ) => {
2728 const enqueuedDump = await client . createDump ( )
28- await client . getDumpStatus ( enqueuedDump . uid ) . then ( ( response ) => {
29- expect ( response . uid ) . toEqual ( enqueuedDump . uid )
30- expect ( response . status ) . toBeDefined ( )
31- } )
29+ await waitForDumpProcessing ( enqueuedDump . uid , client )
30+ const response = await client . getDumpStatus ( enqueuedDump . uid )
31+ expect ( response . uid ) . toEqual ( enqueuedDump . uid )
32+ expect ( response . status ) . toBeDefined ( )
3233 } )
3334} )
3435
0 commit comments