Skip to content

Commit c7e5106

Browse files
author
Artem
committed
fix tests
1 parent cb30d5e commit c7e5106

File tree

3 files changed

+4
-23
lines changed

3 files changed

+4
-23
lines changed

redisinsight/api/test/api/database/PUT-databases-id.test.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -91,27 +91,7 @@ describe(`PUT /databases/:id`, () => {
9191
].map(mainCheckFn);
9292
});
9393
describe('Common', () => {
94-
const newName = constants.getRandomString();
95-
9694
[
97-
{
98-
name: 'Should change name (only) for existing database',
99-
data: {
100-
name: newName,
101-
},
102-
responseSchema,
103-
before: async () => {
104-
oldDatabase = await localDb.getInstanceById(constants.TEST_INSTANCE_ID);
105-
expect(oldDatabase.name).to.not.eq(newName);
106-
},
107-
responseBody: {
108-
name: newName,
109-
},
110-
after: async () => {
111-
newDatabase = await localDb.getInstanceById(constants.TEST_INSTANCE_ID);
112-
expect(newDatabase.name).to.eq(newName);
113-
},
114-
},
11595
{
11696
name: 'Should return 503 error if incorrect connection data provided',
11797
data: {

redisinsight/api/test/helpers/local-db.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,8 @@ export const createDatabaseInstances = async () => {
292292
host: 'localhost',
293293
port: 3679,
294294
connectionType: 'STANDALONE',
295-
...instance
295+
...instance,
296+
modules: '[]',
296297
});
297298
}
298299
}

redisinsight/ui/src/slices/tests/instances/instances.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ describe('instances slice', () => {
10231023
newName: 'newAlias',
10241024
}
10251025
const responsePayload = { status: 200, data }
1026-
apiService.put = jest.fn().mockResolvedValue(responsePayload)
1026+
apiService.patch = jest.fn().mockResolvedValue(responsePayload)
10271027

10281028
// Act
10291029
await store.dispatch<any>(
@@ -1047,7 +1047,7 @@ describe('instances slice', () => {
10471047
data: { message: errorMessage },
10481048
},
10491049
}
1050-
apiService.put = jest.fn().mockRejectedValue(responsePayload)
1050+
apiService.patch = jest.fn().mockRejectedValue(responsePayload)
10511051

10521052
// Act
10531053
await store.dispatch<any>(

0 commit comments

Comments
 (0)