Skip to content

Commit 089ef3d

Browse files
committed
#RI-4813 - fix tests
1 parent 3cc9e58 commit 089ef3d

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

redisinsight/api/src/modules/encryption/model.encryptor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export class ModelEncryptor {
2323
async encryptEntity<T>(entity: T): Promise<T> {
2424
const encryptedEntity = cloneClassInstance(entity);
2525

26+
// TODO: implement support depth in field, 'obj.field'
2627
await Promise.all(this.fields.map(async (field) => {
2728
if (entity[field]) {
2829
const { data, encryption } = await this.encryptionService.encrypt(entity[field]);

redisinsight/api/test/api/database/POST-databases.test.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@ describe('POST /databases', () => {
325325
// todo: cover connection error for incorrect username/password
326326
});
327327
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+
});
328332
describe('Cloud details without pass and TLS', function () {
329333
requirements('!rte.tls');
330334
it('Should throw an error if request with cloudDetails and the same connection already exists', async () => {
@@ -351,9 +355,9 @@ describe('POST /databases', () => {
351355
statusCode: 409,
352356
error: 'DatabaseAlreadyExists',
353357
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+
}
357361
},
358362
});
359363
});
@@ -396,9 +400,9 @@ describe('POST /databases', () => {
396400
statusCode: 409,
397401
error: 'DatabaseAlreadyExists',
398402
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+
}
402406
},
403407
});
404408
});

0 commit comments

Comments
 (0)