@@ -325,6 +325,10 @@ describe('POST /databases', () => {
325
325
// todo: cover connection error for incorrect username/password
326
326
} ) ;
327
327
describe ( 'Cloud details' , function ( ) {
328
+ before ( async ( ) => {
329
+ await ( await localDb . getRepository ( localDb . repositories . DATABASE ) ) . clear ( ) ;
330
+ await localDb . createTestDbInstance ( rte , { } , { id : constants . TEST_INSTANCE_ID } )
331
+ } ) ;
328
332
describe ( 'Cloud details without pass and TLS' , function ( ) {
329
333
requirements ( '!rte.tls' ) ;
330
334
it ( 'Should throw an error if request with cloudDetails and the same connection already exists' , async ( ) => {
@@ -351,9 +355,9 @@ describe('POST /databases', () => {
351
355
statusCode : 409 ,
352
356
error : 'DatabaseAlreadyExists' ,
353
357
errorCode : CustomErrorCodes . DatabaseAlreadyExists ,
354
- } ,
355
- checkFn : ( { body } ) => {
356
- expect ( body . resource . databaseId ) . to . be . a ( 'string' ) ;
358
+ resource : {
359
+ databaseId : constants . TEST_INSTANCE_ID ,
360
+ }
357
361
} ,
358
362
} ) ;
359
363
} ) ;
@@ -396,9 +400,9 @@ describe('POST /databases', () => {
396
400
statusCode : 409 ,
397
401
error : 'DatabaseAlreadyExists' ,
398
402
errorCode : CustomErrorCodes . DatabaseAlreadyExists ,
399
- } ,
400
- checkFn : ( { body } ) => {
401
- expect ( body . resource . databaseId ) . to . be . a ( 'string' ) ;
403
+ resource : {
404
+ databaseId : constants . TEST_INSTANCE_ID ,
405
+ }
402
406
} ,
403
407
} ) ;
404
408
} ) ;
0 commit comments