@@ -2,7 +2,7 @@ import * as path from 'path';
2
2
import * as fs from 'fs' ;
3
3
import { ClientFunction , RequestMock , t } from 'testcafe' ;
4
4
import { Chance } from 'chance' ;
5
- import { apiUrl , commonUrl } from './conf' ;
5
+ import { apiUrl } from './conf' ;
6
6
const archiver = require ( 'archiver' ) ;
7
7
8
8
const chance = new Chance ( ) ;
@@ -13,7 +13,7 @@ declare global {
13
13
}
14
14
}
15
15
16
- const settingsApiUrl = `${ commonUrl } /api/settings` ;
16
+ const settingsApiUrl = `${ apiUrl } /api/settings` ;
17
17
process . env . NODE_TLS_REJECT_UNAUTHORIZED = '0' ; // lgtm[js/disabling-certificate-validation]
18
18
const mockedSettingsResponse = {
19
19
agreements : {
@@ -22,6 +22,12 @@ const mockedSettingsResponse = {
22
22
analytics : false
23
23
}
24
24
} ;
25
+ const mockedSettingsDesktopResponse = {
26
+ agreements : null ,
27
+ batchSize : 5 ,
28
+ scanThreshold : 10000 ,
29
+ theme : null
30
+ } ;
25
31
26
32
export class Common {
27
33
static mockSettingsResponse ( ) : RequestMock {
@@ -30,6 +36,12 @@ export class Common {
30
36
. respond ( mockedSettingsResponse , 200 ) ;
31
37
}
32
38
39
+ static mockDesktopSettingsResponse ( ) : RequestMock {
40
+ return RequestMock ( )
41
+ . onRequestTo ( settingsApiUrl )
42
+ . respond ( mockedSettingsDesktopResponse , 200 ) ;
43
+ }
44
+
33
45
static async waitForElementNotVisible ( elm : Selector ) : Promise < void > {
34
46
await t . expect ( elm . exists ) . notOk ( { timeout : 10000 } ) ;
35
47
}
0 commit comments