From ef932b2c8a0b201a2ef1eee4fc978dd22fcdd4d9 Mon Sep 17 00:00:00 2001 From: Philippe Perrin Date: Fri, 15 May 2020 18:02:23 +0200 Subject: [PATCH] Bump to sonar-ui-common@1.0.2 --- server/sonar-docs/package.json | 11 +---------- server/sonar-docs/yarn.lock | 8 ++++---- server/sonar-web/config/jest/SetupTestEnvironment.ts | 7 +++++++ server/sonar-web/jest.config.js | 4 +--- server/sonar-web/package.json | 2 +- server/sonar-web/yarn.lock | 8 ++++---- 6 files changed, 18 insertions(+), 22 deletions(-) diff --git a/server/sonar-docs/package.json b/server/sonar-docs/package.json index cfdcbc2fa75..7995c79a066 100644 --- a/server/sonar-docs/package.json +++ b/server/sonar-docs/package.json @@ -21,7 +21,7 @@ "react-dom": "16.13.0", "react-helmet": "5.2.1", "react-typography": "0.16.19", - "sonar-ui-common": "1.0.0", + "sonar-ui-common": "1.0.2", "typography": "0.16.19" }, "devDependencies": { @@ -78,15 +78,6 @@ "singleQuote": true }, "jest": { - "globals": { - "ts-jest": { - "diagnostics": { - "ignoreCodes": [ - 151001 - ] - } - } - }, "moduleFileExtensions": [ "ts", "tsx", diff --git a/server/sonar-docs/yarn.lock b/server/sonar-docs/yarn.lock index 66034d35704..31bb6c83693 100644 --- a/server/sonar-docs/yarn.lock +++ b/server/sonar-docs/yarn.lock @@ -12736,10 +12736,10 @@ sockjs@0.3.19: faye-websocket "^0.10.0" uuid "^3.0.1" -sonar-ui-common@1.0.0: - version "1.0.0" - resolved "https://repox.jfrog.io/repox/api/npm/npm/sonar-ui-common/-/sonar-ui-common-1.0.0.tgz#060bce001925fcce1b86696058819941d3883c63" - integrity sha1-BgvOABkl/M4bhmlgWIGZQdOIPGM= +sonar-ui-common@1.0.2: + version "1.0.2" + resolved "https://repox.jfrog.io/repox/api/npm/npm/sonar-ui-common/-/sonar-ui-common-1.0.2.tgz#a2ae3310e70898696b236e2e53c6a8e3f7e235af" + integrity sha1-oq4zEOcImGlrI24uU8ao4/fiNa8= dependencies: "@types/react-select" "1.2.6" classnames "2.2.6" diff --git a/server/sonar-web/config/jest/SetupTestEnvironment.ts b/server/sonar-web/config/jest/SetupTestEnvironment.ts index e60b3048b4c..afee3317208 100644 --- a/server/sonar-web/config/jest/SetupTestEnvironment.ts +++ b/server/sonar-web/config/jest/SetupTestEnvironment.ts @@ -18,7 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import ThemeContext from 'sonar-ui-common/components/theme'; import SonarUiCommonInitializer, { DEFAULT_LOCALE } from 'sonar-ui-common/helpers/init'; +import * as theme from '../../src/main/js/app/theme'; const content = document.createElement('div'); content.id = 'content'; @@ -29,3 +31,8 @@ const baseUrl = ''; SonarUiCommonInitializer.setLocale(DEFAULT_LOCALE) .setMessages({}) .setUrlContext(baseUrl); + +// Hack : override the default value of the context used for theme by emotion +// This allows tests to get the theme value without specifiying a theme provider +ThemeContext['_currentValue'] = theme; +ThemeContext['_currentValue2'] = theme; diff --git a/server/sonar-web/jest.config.js b/server/sonar-web/jest.config.js index 37a3d45c5ad..6b1d649224e 100644 --- a/server/sonar-web/jest.config.js +++ b/server/sonar-web/jest.config.js @@ -4,9 +4,7 @@ module.exports = { coverageReporters: ['lcovonly', 'text'], globals: { 'ts-jest': { - diagnostics: { - ignoreCodes: [151001] - } + diagnostics: false } }, moduleFileExtensions: ['ts', 'tsx', 'js', 'json'], diff --git a/server/sonar-web/package.json b/server/sonar-web/package.json index 43696825ec1..16f87f3472e 100644 --- a/server/sonar-web/package.json +++ b/server/sonar-web/package.json @@ -38,7 +38,7 @@ "rehype-slug": "3.0.0", "remark-custom-blocks": "2.5.0", "remark-rehype": "6.0.0", - "sonar-ui-common": "1.0.0", + "sonar-ui-common": "1.0.2", "unist-util-visit": "2.0.2", "valid-url": "1.0.9", "whatwg-fetch": "3.0.0" diff --git a/server/sonar-web/yarn.lock b/server/sonar-web/yarn.lock index 65dfc107c10..25f74125aff 100644 --- a/server/sonar-web/yarn.lock +++ b/server/sonar-web/yarn.lock @@ -10522,10 +10522,10 @@ sockjs@0.3.19: faye-websocket "^0.10.0" uuid "^3.0.1" -sonar-ui-common@1.0.0: - version "1.0.0" - resolved "https://repox.jfrog.io/repox/api/npm/npm/sonar-ui-common/-/sonar-ui-common-1.0.0.tgz#060bce001925fcce1b86696058819941d3883c63" - integrity sha1-BgvOABkl/M4bhmlgWIGZQdOIPGM= +sonar-ui-common@1.0.2: + version "1.0.2" + resolved "https://repox.jfrog.io/repox/api/npm/npm/sonar-ui-common/-/sonar-ui-common-1.0.2.tgz#a2ae3310e70898696b236e2e53c6a8e3f7e235af" + integrity sha1-oq4zEOcImGlrI24uU8ao4/fiNa8= dependencies: "@types/react-select" "1.2.6" classnames "2.2.6" -- 2.39.5