Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ describe('ServerService', () => {
anonymousId: mockServer.id,
sessionId,
appType: SERVER_CONFIG.buildType,
appVersion: SERVER_CONFIG.appVersion,
controlNumber: mockControlNumber,
controlGroup: mockControlGroup,
},
Expand Down
18 changes: 11 additions & 7 deletions redisinsight/api/test/api/feature/GET-features.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ const updateSettings = (data) => request(server).patch('/settings').send(data);

const mainCheckFn = getMainCheckFn(endpoint);

const waitForFlags = async (flags: any) => {
const waitForFlags = async (flags: any, action?: Function) => {
const client = await getSocket('');

await new Promise((res, rej) => {
try {
action?.()?.catch(rej);
} catch (e) {
rej(e);
}

client.once('features', (data) => {
expect(flags).to.deep.eq(data);
res(true);
Expand Down Expand Up @@ -61,7 +67,7 @@ describe('GET /features', () => {

// remove all configs
await featureConfigRepository.delete({});
await syncEndpoint();
await featureRepository.delete({});
await waitForFlags({
features: {
insightsRecommendations: {
Expand All @@ -73,7 +79,7 @@ describe('GET /features', () => {
name: 'cloudSso',
},
},
});
}, syncEndpoint);
},
statusCode: 200,
responseBody: {
Expand Down Expand Up @@ -111,7 +117,6 @@ describe('GET /features', () => {

// remove all configs

await syncEndpoint();
await waitForFlags({
features: {
insightsRecommendations: {
Expand All @@ -123,7 +128,7 @@ describe('GET /features', () => {
name: 'cloudSso',
},
},
});
}, syncEndpoint);
},
statusCode: 200,
responseBody: {
Expand Down Expand Up @@ -164,7 +169,6 @@ describe('GET /features', () => {
},
})).catch(console.error);

await syncEndpoint();
await waitForFlags({
features: {
insightsRecommendations: {
Expand All @@ -176,7 +180,7 @@ describe('GET /features', () => {
name: 'cloudSso',
},
},
});
}, syncEndpoint);
},
statusCode: 200,
responseBody: {
Expand Down