From 508689e0fd9245e474411d1e387eee74cbc766c4 Mon Sep 17 00:00:00 2001 From: Wouter Admiraal Date: Thu, 19 Aug 2021 15:52:39 +0200 Subject: SONAR-15297 Remove all sonar-ui-common theming logic --- .../sonar-web/src/main/js/helpers/__tests__/request-test.ts | 7 ------- server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts | 12 ++++++++---- 2 files changed, 8 insertions(+), 11 deletions(-) (limited to 'server/sonar-web/src/main/js/helpers') 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'); -- cgit v1.2.3