Skip to content

Commit 38cb1c9

Browse files
fix tests. again :(
1 parent 33c792d commit 38cb1c9

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

redisinsight/api/src/modules/settings/dto/settings.dto.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ export class GetAppSettingsResponse {
7676
example: 10000,
7777
})
7878
@Expose()
79-
@Default(REDIS_SCAN_CONFIG.countThreshold)
80-
scanThreshold: number = REDIS_SCAN_CONFIG.countThreshold;
79+
@Default(REDIS_SCAN_CONFIG.scanThreshold)
80+
scanThreshold: number = REDIS_SCAN_CONFIG.scanThreshold;
8181

8282
@ApiProperty({
8383
description: 'Applied the batch of the commands for workbench.',

redisinsight/api/src/modules/settings/settings.service.spec.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
mockAgreementsRepository, mockAppSettings,
66
mockEncryptionStrategyInstance, mockKeyEncryptionStrategyInstance, mockSessionMetadata, mockSettings,
77
mockSettingsAnalyticsService, mockSettingsRepository,
8-
MockType, mockUserId,
8+
MockType,
99
} from 'src/__mocks__';
1010
import { UpdateSettingsDto } from 'src/modules/settings/dto/settings.dto';
1111
import * as AGREEMENTS_SPEC from 'src/constants/agreements-spec.json';
@@ -38,7 +38,6 @@ describe('SettingsService', () => {
3838
let settingsRepository: MockType<SettingsRepository>;
3939
let analyticsService: SettingsAnalytics;
4040
let keytarStrategy: MockType<KeytarEncryptionStrategy>;
41-
let keyStrategy: MockType<KeyEncryptionStrategy>;
4241
let eventEmitter: EventEmitter2;
4342

4443
beforeEach(async () => {
@@ -75,13 +74,12 @@ describe('SettingsService', () => {
7574
],
7675
}).compile();
7776

78-
agreementsRepository = await module.get(AgreementsRepository);
79-
settingsRepository = await module.get(SettingsRepository);
80-
keytarStrategy = await module.get(KeytarEncryptionStrategy);
81-
keyStrategy = await module.get(KeyEncryptionStrategy);
82-
analyticsService = await module.get<SettingsAnalytics>(SettingsAnalytics);
83-
service = await module.get(SettingsService);
84-
eventEmitter = await module.get(EventEmitter2);
77+
agreementsRepository = module.get(AgreementsRepository);
78+
settingsRepository = module.get(SettingsRepository);
79+
keytarStrategy = module.get(KeytarEncryptionStrategy);
80+
analyticsService = module.get(SettingsAnalytics);
81+
service = module.get(SettingsService);
82+
eventEmitter = module.get(EventEmitter2);
8583
});
8684

8785
describe('getAppSettings', () => {
@@ -93,7 +91,7 @@ describe('SettingsService', () => {
9391

9492
expect(result).toEqual({
9593
theme: null,
96-
scanThreshold: REDIS_SCAN_CONFIG.countThreshold,
94+
scanThreshold: REDIS_SCAN_CONFIG.scanThreshold,
9795
batchSize: WORKBENCH_CONFIG.countBatch,
9896
agreements: null,
9997
});
@@ -212,7 +210,7 @@ describe('SettingsService', () => {
212210
expect(analyticsService.sendAnalyticsAgreementChange).not.toHaveBeenCalled();
213211
expect(analyticsService.sendSettingsUpdatedEvent).toHaveBeenCalledWith(mockAppSettings, {
214212
...mockAppSettings,
215-
scanThreshold: REDIS_SCAN_CONFIG.countThreshold,
213+
scanThreshold: REDIS_SCAN_CONFIG.scanThreshold,
216214
batchSize: WORKBENCH_CONFIG.countBatch,
217215
theme: null,
218216
});

redisinsight/api/test/api/keys/POST-databases-id-keys.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ describe('POST /databases/:id/keys', () => {
189189
count: 100,
190190
cursor: '0',
191191
match: 'not_exist_key*',
192-
countThreshold: 500,
192+
scanThreshold: 500,
193193
},
194194
responseSchema,
195195
after: async () => await initSettings(),

0 commit comments

Comments
 (0)