Skip to content

Commit da764f0

Browse files
#RI-4881_fix_IT_tests (#2687)
1 parent 4ef107f commit da764f0

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

redisinsight/api/src/modules/database/repositories/local.database.repository.spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,24 @@ describe('LocalDatabaseRepository', () => {
229229
expect(caCertRepository.get).not.toHaveBeenCalled();
230230
expect(clientCertRepository.get).not.toHaveBeenCalled();
231231
});
232+
233+
it('should return standalone database model without omit fields', async () => {
234+
const omitFields = ['compressor', 'connectionType'];
235+
const result = await service.get(mockDatabaseId, false, omitFields);
236+
237+
expect(result).toEqual(omit(mockDatabase, omitFields));
238+
});
239+
240+
it('should return standalone database model without nested fields', async () => {
241+
const omitFields = ['compressor', 'sshOptions.passphrase', 'sshOptions.privateKey'];
242+
243+
repository.findOneBy.mockResolvedValueOnce(mockDatabaseWithSshPrivateKeyEntity);
244+
const result = await service.get(mockDatabaseWithSshPrivateKey.id, false, omitFields);
245+
246+
expect(result).toEqual(omit(cloneClassInstance(mockDatabaseWithSshPrivateKey), omitFields));
247+
expect(caCertRepository.get).not.toHaveBeenCalled();
248+
expect(clientCertRepository.get).not.toHaveBeenCalled();
249+
});
232250
});
233251

234252
describe('list', () => {

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ describe('POST /databases', () => {
138138
host: constants.TEST_REDIS_HOST,
139139
port: constants.TEST_REDIS_PORT,
140140
username: null,
141-
password: null,
142141
connectionType: constants.STANDALONE,
143142
new: true,
144143
},
@@ -194,7 +193,6 @@ describe('POST /databases', () => {
194193
host: constants.TEST_REDIS_HOST,
195194
port: constants.TEST_REDIS_PORT,
196195
username: null,
197-
password: null,
198196
connectionType: constants.STANDALONE,
199197
new: true,
200198
},
@@ -242,7 +240,6 @@ describe('POST /databases', () => {
242240
port: constants.TEST_REDIS_PORT,
243241
db: constants.TEST_REDIS_DB_INDEX,
244242
username: null,
245-
password: null,
246243
connectionType: constants.STANDALONE,
247244
new: true,
248245
},

0 commit comments

Comments
 (0)