@@ -334,19 +334,27 @@ describe.each([{ permission: 'Master' }, { permission: 'Private' }])(
334334 const { uid } = await client . createIndex ( indexPk . uid )
335335 await client . waitForTask ( uid )
336336
337- const response = await client . index ( indexPk . uid ) . getRawInfo ( )
337+ const index = client . index ( indexPk . uid )
338+ await index . getRawInfo ( )
338339
339- expect ( response ) . toBeDefined ( )
340- expect ( response ) . toBeDefined ( )
340+ expect ( index . createdAt ) . toBeInstanceOf ( Date )
341+ expect ( index . updatedAt ) . toBeInstanceOf ( Date )
341342 } )
342343
343- test ( `${ permission } key: Get updatedAt and createdAt from initialized index ` , async ( ) => {
344+ test ( `${ permission } key: Get updatedAt and createdAt index witch fetched information ` , async ( ) => {
344345 const client = await getClient ( permission )
346+ const { uid } = await client . createIndex ( indexPk . uid )
347+ await client . waitForTask ( uid )
348+
349+ const index = client . index ( indexPk . uid )
350+
351+ expect ( index . createdAt ) . toBe ( undefined )
352+ expect ( index . updatedAt ) . toBe ( undefined )
345353
346- const response = await client . index ( indexPk . uid )
354+ await index . getRawInfo ( )
347355
348- expect ( response . createdAt ) . toBeUndefined ( )
349- expect ( response . updatedAt ) . toBeUndefined ( )
356+ expect ( index . createdAt ) . toBeInstanceOf ( Date )
357+ expect ( index . updatedAt ) . toBeInstanceOf ( Date )
350358 } )
351359 }
352360)
0 commit comments