@@ -326,8 +326,7 @@ describe('POST /databases', () => {
326
326
} ) ;
327
327
describe ( 'Cloud details' , function ( ) {
328
328
before ( async ( ) => {
329
- await ( await localDb . getRepository ( localDb . repositories . DATABASE ) ) . clear ( ) ;
330
- await localDb . createTestDbInstance ( rte , { } , { id : constants . TEST_INSTANCE_ID } )
329
+ await localDb . initLocalDb ( deps . rte , deps . server )
331
330
} ) ;
332
331
describe ( 'Cloud details without pass and TLS' , function ( ) {
333
332
requirements ( '!rte.tls' ) ;
@@ -355,9 +354,12 @@ describe('POST /databases', () => {
355
354
statusCode : 409 ,
356
355
error : 'DatabaseAlreadyExists' ,
357
356
errorCode : CustomErrorCodes . DatabaseAlreadyExists ,
358
- resource : {
359
- databaseId : constants . TEST_INSTANCE_ID ,
360
- }
357
+ } ,
358
+ checkFn : async ( { body } ) => {
359
+ const database = await ( await localDb . getRepository ( localDb . repositories . DATABASE ) )
360
+ . findOneBy ( { host : constants . TEST_REDIS_HOST } ) ;
361
+
362
+ expect ( body . resource . databaseId ) . to . eq ( database . id ) ;
361
363
} ,
362
364
} ) ;
363
365
} ) ;
@@ -400,9 +402,12 @@ describe('POST /databases', () => {
400
402
statusCode : 409 ,
401
403
error : 'DatabaseAlreadyExists' ,
402
404
errorCode : CustomErrorCodes . DatabaseAlreadyExists ,
403
- resource : {
404
- databaseId : constants . TEST_INSTANCE_ID ,
405
- }
405
+ } ,
406
+ checkFn : async ( { body } ) => {
407
+ const database = await ( await localDb . getRepository ( localDb . repositories . DATABASE ) )
408
+ . findOneBy ( { host : constants . TEST_REDIS_HOST } ) ;
409
+
410
+ expect ( body . resource . databaseId ) . to . eq ( database . id ) ;
406
411
} ,
407
412
} ) ;
408
413
} ) ;
0 commit comments