Skip to content

Commit 14a5675

Browse files
committed
fixes for eula
1 parent 3f4dc66 commit 14a5675

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

tests/e2e/helpers/common.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as path from 'path';
22
import * as fs from 'fs';
33
import { ClientFunction, RequestMock, t } from 'testcafe';
44
import { Chance } from 'chance';
5-
import { apiUrl, commonUrl } from './conf';
5+
import { apiUrl } from './conf';
66
const archiver = require('archiver');
77

88
const chance = new Chance();
@@ -13,7 +13,7 @@ declare global {
1313
}
1414
}
1515

16-
const settingsApiUrl = `${commonUrl}/api/settings`;
16+
const settingsApiUrl = `${apiUrl}/api/settings`;
1717
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; // lgtm[js/disabling-certificate-validation]
1818
const mockedSettingsResponse = {
1919
agreements: {
@@ -22,6 +22,12 @@ const mockedSettingsResponse = {
2222
analytics: false
2323
}
2424
};
25+
const mockedSettingsDesktopResponse = {
26+
agreements: null,
27+
batchSize: 5,
28+
scanThreshold: 10000,
29+
theme: null
30+
};
2531

2632
export class Common {
2733
static mockSettingsResponse(): RequestMock {
@@ -30,6 +36,12 @@ export class Common {
3036
.respond(mockedSettingsResponse, 200);
3137
}
3238

39+
static mockDesktopSettingsResponse(): RequestMock {
40+
return RequestMock()
41+
.onRequestTo(settingsApiUrl)
42+
.respond(mockedSettingsDesktopResponse, 200);
43+
}
44+
3345
static async waitForElementNotVisible(elm: Selector): Promise<void> {
3446
await t.expect(elm.exists).notOk({ timeout: 10000 });
3547
}

tests/e2e/tests/electron/critical-path/a-first-start-form/user-agreements-form.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const dbPath = `${workingDirectory}/redisinsight.db`;
1212
fixture `Agreements Verification`
1313
.meta({ type: 'critical_path', rte: rte.none })
1414
.page(commonUrl)
15-
.requestHooks(Common.mockSettingsResponse());
15+
.requestHooks(Common.mockDesktopSettingsResponse());
1616
test
1717
.before(async() => {
1818
await Common.deleteFileFromFolderIfExists(dbPath);

0 commit comments

Comments
 (0)