Skip to content

Commit d6d0c74

Browse files
#RI-3704 - uncomment tests
1 parent def98d1 commit d6d0c74

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

redisinsight/api/src/modules/bulk-actions/models/runners/simple/abstract.bulk-action.simple.runner.spec.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,21 @@ describe('AbstractBulkActionSimpleRunner', () => {
5454
deleteRunner = new DeleteBulkActionSimpleRunner(bulkAction, nodeClient);
5555
});
5656

57-
// describe('prepareToStart', () => {
58-
// it('should get total before start', async () => {
59-
// nodeClient.sendCommand.mockResolvedValueOnce(mockRedisKeyspaceInfoResponse);
57+
describe('prepareToStart', () => {
58+
it('should get total before start', async () => {
59+
nodeClient.sendCommand.mockResolvedValueOnce(mockRedisKeyspaceInfoResponse);
6060

61-
// expect(deleteRunner['progress']['total']).toEqual(0);
62-
// expect(deleteRunner['progress']['scanned']).toEqual(0);
63-
// expect(deleteRunner['progress']['cursor']).toEqual(0);
61+
expect(deleteRunner['progress']['total']).toEqual(0);
62+
expect(deleteRunner['progress']['scanned']).toEqual(0);
63+
expect(deleteRunner['progress']['cursor']).toEqual(0);
6464

65-
// await deleteRunner.prepareToStart();
65+
await deleteRunner.prepareToStart();
6666

67-
// expect(deleteRunner['progress']['total']).toEqual(100);
68-
// expect(deleteRunner['progress']['scanned']).toEqual(0);
69-
// expect(deleteRunner['progress']['cursor']).toEqual(0);
70-
// });
71-
// });
67+
expect(deleteRunner['progress']['total']).toEqual(100);
68+
expect(deleteRunner['progress']['scanned']).toEqual(0);
69+
expect(deleteRunner['progress']['cursor']).toEqual(0);
70+
});
71+
});
7272

7373
describe('getKeysToProcess', () => {
7474
beforeEach(() => {

redisinsight/api/src/modules/database-analysis/scanner/keys-scanner.spec.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -113,28 +113,28 @@ describe('KeysScanner', () => {
113113
});
114114
});
115115

116-
// describe('getNodeTotal', () => {
117-
// it('get total keys in db', async () => {
118-
// expect(await service.getNodeTotal(nodeClient)).toEqual(1);
119-
// });
120-
// it('get total keys in db (db:3)', async () => {
121-
// const client = Object.assign(nodeClient);
122-
// client.options = { db: 3 };
123-
// expect(await service.getNodeTotal(client)).toEqual(100);
124-
// });
125-
// it('get total keys in db (no keyspace data)', async () => {
126-
// when(nodeClient.sendCommand)
127-
// .calledWith(jasmine.objectContaining({ name: 'info' }))
128-
// .mockResolvedValueOnce(mockRedisKeyspaceInfoResponseNoKeyspaceData);
116+
describe('getNodeTotal', () => {
117+
it('get total keys in db', async () => {
118+
expect(await service.getNodeTotal(nodeClient)).toEqual(1);
119+
});
120+
it('get total keys in db (db:3)', async () => {
121+
const client = Object.assign(nodeClient);
122+
client.options = { db: 3 };
123+
expect(await service.getNodeTotal(client)).toEqual(100);
124+
});
125+
it('get total keys in db (no keyspace data)', async () => {
126+
when(nodeClient.sendCommand)
127+
.calledWith(jasmine.objectContaining({ name: 'info' }))
128+
.mockResolvedValueOnce(mockRedisKeyspaceInfoResponseNoKeyspaceData);
129129

130-
// expect(await service.getNodeTotal(nodeClient)).toEqual(0);
131-
// });
132-
// it('get total keys in db (no info data)', async () => {
133-
// when(nodeClient.sendCommand)
134-
// .calledWith(jasmine.objectContaining({ name: 'info' }))
135-
// .mockResolvedValueOnce(mockRedisKeyspaceInfoResponseEmpty);
130+
expect(await service.getNodeTotal(nodeClient)).toEqual(0);
131+
});
132+
it('get total keys in db (no info data)', async () => {
133+
when(nodeClient.sendCommand)
134+
.calledWith(jasmine.objectContaining({ name: 'info' }))
135+
.mockResolvedValueOnce(mockRedisKeyspaceInfoResponseEmpty);
136136

137-
// expect(await service.getNodeTotal(nodeClient)).toEqual(0);
138-
// });
139-
// });
137+
expect(await service.getNodeTotal(nodeClient)).toEqual(0);
138+
});
139+
});
140140
});

0 commit comments

Comments
 (0)