aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/helpers
diff options
context:
space:
mode:
authorWouter Admiraal <wouter.admiraal@sonarsource.com>2021-08-19 15:52:39 +0200
committersonartech <sonartech@sonarsource.com>2021-08-20 20:03:10 +0000
commit508689e0fd9245e474411d1e387eee74cbc766c4 (patch)
tree2bb8ea7657808c8c0ac00194ba9df714d536b1c6 /server/sonar-web/src/main/js/helpers
parent2d0873e027ff54dbb470c46b76b04f98caa48384 (diff)
downloadsonarqube-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.ts7
-rw-r--r--server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts12
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');