diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2021-08-19 15:52:39 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-08-20 20:03:10 +0000 |
commit | 508689e0fd9245e474411d1e387eee74cbc766c4 (patch) | |
tree | 2bb8ea7657808c8c0ac00194ba9df714d536b1c6 /server/sonar-web/src/main/js/helpers | |
parent | 2d0873e027ff54dbb470c46b76b04f98caa48384 (diff) | |
download | sonarqube-508689e0fd9245e474411d1e387eee74cbc766c4.tar.gz sonarqube-508689e0fd9245e474411d1e387eee74cbc766c4.zip |
SONAR-15297 Remove all sonar-ui-common theming logic
Diffstat (limited to 'server/sonar-web/src/main/js/helpers')
-rw-r--r-- | server/sonar-web/src/main/js/helpers/__tests__/request-test.ts | 7 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts | 12 |
2 files changed, 8 insertions, 11 deletions
diff --git a/server/sonar-web/src/main/js/helpers/__tests__/request-test.ts b/server/sonar-web/src/main/js/helpers/__tests__/request-test.ts index 6cdb0e4b1e0..f4729185ef4 100644 --- a/server/sonar-web/src/main/js/helpers/__tests__/request-test.ts +++ b/server/sonar-web/src/main/js/helpers/__tests__/request-test.ts @@ -38,13 +38,6 @@ import { jest.mock('../handleRequiredAuthentication', () => ({ default: jest.fn() })); -jest.mock('../init', () => { - const module = jest.requireActual('../init'); - return { - ...module, - getRequestOptions: jest.fn().mockReturnValue({}) - }; -}); const url = '/my-url'; beforeEach(() => { diff --git a/server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts b/server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts index 7e067b7aa9e..bfa2ac6b793 100644 --- a/server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts +++ b/server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts @@ -222,16 +222,20 @@ describe('#getHostUrl', () => { jest.resetModules(); }); it('should return host url on client side', () => { - jest.mock('../init', () => ({ - getUrlContext: () => '', + jest.mock('../system', () => ({ + getBaseUrl: () => '' + })); + jest.mock('../browser', () => ({ IS_SSR: false })); const mockedUrls = require('../urls'); expect(mockedUrls.getHostUrl()).toBe('http://localhost'); }); it('should throw on server-side', () => { - jest.mock('../init', () => ({ - getUrlContext: () => '', + jest.mock('../system', () => ({ + getBaseUrl: () => '' + })); + jest.mock('../browser', () => ({ IS_SSR: true })); const mockedUrls = require('../urls'); |