From dc8d21a2cbb4e1093f6c5d3811a8f2b3d3686fa5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 25 Jan 2021 18:37:28 +0000 Subject: [PATCH] fix(deps): update dependency react-select to v4 (#2663) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(deps): update dependency react-select to v4 * fix(tests): fix tests for react-select v4 Co-authored-by: Renovate Bot Co-authored-by: Ɓukasz Mierzwa --- ui/package-lock.json | 292 ++++++++++++++---- ui/package.json | 4 +- .../AlertGroupCollapseConfiguration.test.tsx | 9 +- .../AlertGroupSortConfiguration.test.tsx | 8 +- .../MultiGridConfiguration.test.tsx | 8 +- .../Configuration/ThemeConfiguration.test.tsx | 8 +- ...rtGroupCollapseConfiguration.test.tsx.snap | 2 +- .../AlertGroupSortConfiguration.test.tsx.snap | 2 +- .../MultiGridConfiguration.test.tsx.snap | 2 +- .../ThemeConfiguration.test.tsx.snap | 2 +- .../__snapshots__/index.test.tsx.snap | 8 +- .../MainModalContent.test.tsx.snap | 8 +- ui/src/Components/NavBar/index.test.tsx | 9 +- .../__snapshots__/index.test.tsx.snap | 8 +- .../AlertManagerInput/index.test.tsx | 9 +- .../SilenceModal/AlertManagerInput/index.tsx | 4 +- .../SilenceModal/SilenceForm.test.tsx | 9 +- .../SilenceMatch/LabelNameInput.test.tsx | 8 +- .../SilenceMatch/LabelValueInput.test.tsx | 9 +- .../SilenceMatch/LabelValueInput.tsx | 2 +- .../LabelNameInput.test.tsx.snap | 2 +- .../LabelValueInput.test.tsx.snap | 4 +- .../SilenceModal/SilenceModalContent.test.tsx | 9 +- .../__snapshots__/ReactSelect.test.tsx.snap | 20 +- 24 files changed, 325 insertions(+), 121 deletions(-) diff --git a/ui/package-lock.json b/ui/package-lock.json index e679d8fe7..bb586efa6 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -1223,21 +1223,49 @@ "resolved": "https://registry.npmjs.org/@csstools/normalize.css/-/normalize.css-10.1.0.tgz", "integrity": "sha512-ij4wRiunFfaJxjB0BdrYHIH8FxBJpOwNPhhAcunlmPdXudL1WQV1qoP9un6JsEBAgQH+7UXyyjh0g7jTxXK6tg==" }, - "@emotion/cache": { - "version": "10.0.29", - "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-10.0.29.tgz", - "integrity": "sha512-fU2VtSVlHiF27empSbxi1O2JFdNWZO+2NFHfwO0pxgTep6Xa3uGb+3pVKfLww2l/IBGLNEZl5Xf/++A4wAYDYQ==", + "@emotion/babel-plugin": { + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.1.2.tgz", + "integrity": "sha512-Nz1k7b11dWw8Nw4Z1R99A9mlB6C6rRsCtZnwNUOj4NsoZdrO2f2A/83ST7htJORD5zpOiLKY59aJN23092949w==", "requires": { - "@emotion/sheet": "0.9.4", - "@emotion/stylis": "0.8.5", - "@emotion/utils": "0.11.3", - "@emotion/weak-memoize": "0.2.5" + "@babel/helper-module-imports": "^7.7.0", + "@babel/plugin-syntax-jsx": "^7.12.1", + "@babel/runtime": "^7.7.2", + "@emotion/hash": "^0.8.0", + "@emotion/memoize": "^0.7.5", + "@emotion/serialize": "^1.0.0", + "babel-plugin-macros": "^2.6.1", + "convert-source-map": "^1.5.0", + "escape-string-regexp": "^4.0.0", + "find-root": "^1.1.0", + "source-map": "^0.5.7", + "stylis": "^4.0.3" + }, + "dependencies": { + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" + } + } + }, + "@emotion/cache": { + "version": "11.1.3", + "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.1.3.tgz", + "integrity": "sha512-n4OWinUPJVaP6fXxWZD9OUeQ0lY7DvtmtSuqtRWT0Ofo/sBLCVSgb4/Oa0Q5eFxcwablRKjUXqXtNZVyEwCAuA==", + "requires": { + "@emotion/memoize": "^0.7.4", + "@emotion/sheet": "^1.0.0", + "@emotion/utils": "^1.0.0", + "@emotion/weak-memoize": "^0.2.5", + "stylis": "^4.0.3" } }, "@emotion/core": { "version": "10.1.1", "resolved": "https://registry.npmjs.org/@emotion/core/-/core-10.1.1.tgz", "integrity": "sha512-ZMLG6qpXR8x031NXD8HJqugy/AZSkAuMxxqB46pmAR7ze47MhNJ56cdoX243QPZdGctrdfo+s08yZTiwaUcRKA==", + "dev": true, "requires": { "@babel/runtime": "^7.5.5", "@emotion/cache": "^10.0.27", @@ -1245,16 +1273,80 @@ "@emotion/serialize": "^0.11.15", "@emotion/sheet": "0.9.4", "@emotion/utils": "0.11.3" + }, + "dependencies": { + "@emotion/cache": { + "version": "10.0.29", + "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-10.0.29.tgz", + "integrity": "sha512-fU2VtSVlHiF27empSbxi1O2JFdNWZO+2NFHfwO0pxgTep6Xa3uGb+3pVKfLww2l/IBGLNEZl5Xf/++A4wAYDYQ==", + "dev": true, + "requires": { + "@emotion/sheet": "0.9.4", + "@emotion/stylis": "0.8.5", + "@emotion/utils": "0.11.3", + "@emotion/weak-memoize": "0.2.5" + } + }, + "@emotion/css": { + "version": "10.0.27", + "resolved": "https://registry.npmjs.org/@emotion/css/-/css-10.0.27.tgz", + "integrity": "sha512-6wZjsvYeBhyZQYNrGoR5yPMYbMBNEnanDrqmsqS1mzDm1cOTu12shvl2j4QHNS36UaTE0USIJawCH9C8oW34Zw==", + "dev": true, + "requires": { + "@emotion/serialize": "^0.11.15", + "@emotion/utils": "0.11.3", + "babel-plugin-emotion": "^10.0.27" + } + }, + "@emotion/memoize": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz", + "integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==", + "dev": true + }, + "@emotion/serialize": { + "version": "0.11.16", + "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-0.11.16.tgz", + "integrity": "sha512-G3J4o8by0VRrO+PFeSc3js2myYNOXVJ3Ya+RGVxnshRYgsvErfAOglKAiy1Eo1vhzxqtUvjCyS5gtewzkmvSSg==", + "dev": true, + "requires": { + "@emotion/hash": "0.8.0", + "@emotion/memoize": "0.7.4", + "@emotion/unitless": "0.7.5", + "@emotion/utils": "0.11.3", + "csstype": "^2.5.7" + } + }, + "@emotion/sheet": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-0.9.4.tgz", + "integrity": "sha512-zM9PFmgVSqBw4zL101Q0HrBVTGmpAxFZH/pYx/cjJT5advXguvcgjHFTCaIO3enL/xr89vK2bh0Mfyj9aa0ANA==", + "dev": true + }, + "@emotion/utils": { + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-0.11.3.tgz", + "integrity": "sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw==", + "dev": true + }, + "csstype": { + "version": "2.6.14", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.14.tgz", + "integrity": "sha512-2mSc+VEpGPblzAxyeR+vZhJKgYg0Og0nnRi7pmRXFYYxSfnOnW8A5wwQb4n4cE2nIOzqKOAzLCaEX6aBmNEv8A==", + "dev": true + } } }, "@emotion/css": { - "version": "10.0.27", - "resolved": "https://registry.npmjs.org/@emotion/css/-/css-10.0.27.tgz", - "integrity": "sha512-6wZjsvYeBhyZQYNrGoR5yPMYbMBNEnanDrqmsqS1mzDm1cOTu12shvl2j4QHNS36UaTE0USIJawCH9C8oW34Zw==", + "version": "11.1.3", + "resolved": "https://registry.npmjs.org/@emotion/css/-/css-11.1.3.tgz", + "integrity": "sha512-RSQP59qtCNTf5NWD6xM08xsQdCZmVYnX/panPYvB6LQAPKQB6GL49Njf0EMbS3CyDtrlWsBcmqBtysFvfWT3rA==", "requires": { - "@emotion/serialize": "^0.11.15", - "@emotion/utils": "0.11.3", - "babel-plugin-emotion": "^10.0.27" + "@emotion/babel-plugin": "^11.0.0", + "@emotion/cache": "^11.1.3", + "@emotion/serialize": "^1.0.0", + "@emotion/sheet": "^1.0.0", + "@emotion/utils": "^1.0.0" } }, "@emotion/hash": { @@ -1269,36 +1361,51 @@ "dev": true, "requires": { "@emotion/memoize": "0.7.4" - } - }, - "@emotion/memoize": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz", - "integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==" - }, - "@emotion/serialize": { - "version": "0.11.16", - "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-0.11.16.tgz", - "integrity": "sha512-G3J4o8by0VRrO+PFeSc3js2myYNOXVJ3Ya+RGVxnshRYgsvErfAOglKAiy1Eo1vhzxqtUvjCyS5gtewzkmvSSg==", - "requires": { - "@emotion/hash": "0.8.0", - "@emotion/memoize": "0.7.4", - "@emotion/unitless": "0.7.5", - "@emotion/utils": "0.11.3", - "csstype": "^2.5.7" }, "dependencies": { - "csstype": { - "version": "2.6.14", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.14.tgz", - "integrity": "sha512-2mSc+VEpGPblzAxyeR+vZhJKgYg0Og0nnRi7pmRXFYYxSfnOnW8A5wwQb4n4cE2nIOzqKOAzLCaEX6aBmNEv8A==" + "@emotion/memoize": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz", + "integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==", + "dev": true } } }, + "@emotion/memoize": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.5.tgz", + "integrity": "sha512-igX9a37DR2ZPGYtV6suZ6whr8pTFtyHL3K/oLUotxpSVO2ASaprmAe2Dkq7tBo7CRY7MMDrAa9nuQP9/YG8FxQ==" + }, + "@emotion/react": { + "version": "11.1.4", + "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.1.4.tgz", + "integrity": "sha512-9gkhrW8UjV4IGRnEe4/aGPkUxoGS23aD9Vu6JCGfEDyBYL+nGkkRBoMFGAzCT9qFdyUvQp4UUtErbKWxq/JS4A==", + "requires": { + "@babel/runtime": "^7.7.2", + "@emotion/cache": "^11.1.3", + "@emotion/serialize": "^1.0.0", + "@emotion/sheet": "^1.0.1", + "@emotion/utils": "^1.0.0", + "@emotion/weak-memoize": "^0.2.5", + "hoist-non-react-statics": "^3.3.1" + } + }, + "@emotion/serialize": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.0.0.tgz", + "integrity": "sha512-zt1gm4rhdo5Sry8QpCOpopIUIKU+mUSpV9WNmFILUraatm5dttNEaYzUWWSboSMUE6PtN2j1cAsuvcugfdI3mw==", + "requires": { + "@emotion/hash": "^0.8.0", + "@emotion/memoize": "^0.7.4", + "@emotion/unitless": "^0.7.5", + "@emotion/utils": "^1.0.0", + "csstype": "^3.0.2" + } + }, "@emotion/sheet": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-0.9.4.tgz", - "integrity": "sha512-zM9PFmgVSqBw4zL101Q0HrBVTGmpAxFZH/pYx/cjJT5advXguvcgjHFTCaIO3enL/xr89vK2bh0Mfyj9aa0ANA==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.0.1.tgz", + "integrity": "sha512-GbIvVMe4U+Zc+929N1V7nW6YYJtidj31lidSmdYcWozwoBIObXBnaJkKNDjZrLm9Nc0BR+ZyHNaRZxqNZbof5g==" }, "@emotion/styled": { "version": "10.0.27", @@ -1320,12 +1427,46 @@ "@emotion/is-prop-valid": "0.8.8", "@emotion/serialize": "^0.11.15", "@emotion/utils": "0.11.3" + }, + "dependencies": { + "@emotion/memoize": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz", + "integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==", + "dev": true + }, + "@emotion/serialize": { + "version": "0.11.16", + "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-0.11.16.tgz", + "integrity": "sha512-G3J4o8by0VRrO+PFeSc3js2myYNOXVJ3Ya+RGVxnshRYgsvErfAOglKAiy1Eo1vhzxqtUvjCyS5gtewzkmvSSg==", + "dev": true, + "requires": { + "@emotion/hash": "0.8.0", + "@emotion/memoize": "0.7.4", + "@emotion/unitless": "0.7.5", + "@emotion/utils": "0.11.3", + "csstype": "^2.5.7" + } + }, + "@emotion/utils": { + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-0.11.3.tgz", + "integrity": "sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw==", + "dev": true + }, + "csstype": { + "version": "2.6.14", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.14.tgz", + "integrity": "sha512-2mSc+VEpGPblzAxyeR+vZhJKgYg0Og0nnRi7pmRXFYYxSfnOnW8A5wwQb4n4cE2nIOzqKOAzLCaEX6aBmNEv8A==", + "dev": true + } } }, "@emotion/stylis": { "version": "0.8.5", "resolved": "https://registry.npmjs.org/@emotion/stylis/-/stylis-0.8.5.tgz", - "integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==" + "integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==", + "dev": true }, "@emotion/unitless": { "version": "0.7.5", @@ -1333,9 +1474,9 @@ "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" }, "@emotion/utils": { - "version": "0.11.3", - "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-0.11.3.tgz", - "integrity": "sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.0.0.tgz", + "integrity": "sha512-mQC2b3XLDs6QCW+pDQDiyO/EdGZYOygE8s5N5rrzjSI4M3IejPE/JPndCBwRT9z982aqQNi6beWs1UeayrQxxA==" }, "@emotion/weak-memoize": { "version": "0.2.5", @@ -4398,9 +4539,9 @@ } }, "@types/react-select": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@types/react-select/-/react-select-3.1.2.tgz", - "integrity": "sha512-ygvR/2FL87R2OLObEWFootYzkvm67LRA+URYEAcBuvKk7IXmdsnIwSGm60cVXGaqkJQHozb2Cy1t94tCYb6rJA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/react-select/-/react-select-4.0.0.tgz", + "integrity": "sha512-nnKHq5DCsqhFWYXO9KIUhcZKgaL0bRghUXliSWzGjo1YKPxFgETXwiqwGU7puwZahW3LvnZANa8wbgv5sn1rBQ==", "requires": { "@types/react": "*", "@types/react-dom": "*", @@ -5634,6 +5775,7 @@ "version": "10.0.33", "resolved": "https://registry.npmjs.org/babel-plugin-emotion/-/babel-plugin-emotion-10.0.33.tgz", "integrity": "sha512-bxZbTTGz0AJQDHm8k6Rf3RQJ8tX2scsfsRyKVgAbiUPUNIRtlK+7JxP+TAd1kRLABFxe0CFm2VdK4ePkoA9FxQ==", + "dev": true, "requires": { "@babel/helper-module-imports": "^7.0.0", "@emotion/hash": "0.8.0", @@ -5645,6 +5787,39 @@ "escape-string-regexp": "^1.0.5", "find-root": "^1.1.0", "source-map": "^0.5.7" + }, + "dependencies": { + "@emotion/memoize": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz", + "integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==", + "dev": true + }, + "@emotion/serialize": { + "version": "0.11.16", + "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-0.11.16.tgz", + "integrity": "sha512-G3J4o8by0VRrO+PFeSc3js2myYNOXVJ3Ya+RGVxnshRYgsvErfAOglKAiy1Eo1vhzxqtUvjCyS5gtewzkmvSSg==", + "dev": true, + "requires": { + "@emotion/hash": "0.8.0", + "@emotion/memoize": "0.7.4", + "@emotion/unitless": "0.7.5", + "@emotion/utils": "0.11.3", + "csstype": "^2.5.7" + } + }, + "@emotion/utils": { + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-0.11.3.tgz", + "integrity": "sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw==", + "dev": true + }, + "csstype": { + "version": "2.6.14", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.14.tgz", + "integrity": "sha512-2mSc+VEpGPblzAxyeR+vZhJKgYg0Og0nnRi7pmRXFYYxSfnOnW8A5wwQb4n4cE2nIOzqKOAzLCaEX6aBmNEv8A==", + "dev": true + } } }, "babel-plugin-istanbul": { @@ -5807,7 +5982,8 @@ "babel-plugin-syntax-jsx": { "version": "6.18.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", - "integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=" + "integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=", + "dev": true }, "babel-plugin-syntax-object-rest-spread": { "version": "6.13.0", @@ -11327,7 +11503,6 @@ "version": "3.3.2", "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dev": true, "requires": { "react-is": "^16.7.0" } @@ -17283,14 +17458,14 @@ } }, "react-select": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/react-select/-/react-select-3.2.0.tgz", - "integrity": "sha512-B/q3TnCZXEKItO0fFN/I0tWOX3WJvi/X2wtdffmwSQVRwg5BpValScTO1vdic9AxlUgmeSzib2hAZAwIUQUZGQ==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/react-select/-/react-select-4.0.2.tgz", + "integrity": "sha512-BiihrRpRIBBvNqofNZIBpo08Kw8DBHb/kgpIDW4bxgkttk50Sxf0alEIKobns3U7UJXk/CA4rsFUueQEg9Pm5A==", "requires": { "@babel/runtime": "^7.4.4", - "@emotion/cache": "^10.0.9", - "@emotion/core": "^10.0.9", - "@emotion/css": "^10.0.9", + "@emotion/cache": "^11.0.0", + "@emotion/css": "^11.0.0", + "@emotion/react": "^11.1.1", "memoize-one": "^5.0.0", "prop-types": "^15.6.0", "react-input-autosize": "^3.0.0", @@ -19465,6 +19640,11 @@ } } }, + "stylis": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.0.6.tgz", + "integrity": "sha512-1igcUEmYFBEO14uQHAJhCUelTR5jPztfdVKrYxRnDa5D5Dn3w0NxXupJNPr/VV/yRfZYEAco8sTIRZzH3sRYKg==" + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -20089,9 +20269,9 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, "tsutils": { - "version": "3.19.1", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.19.1.tgz", - "integrity": "sha512-GEdoBf5XI324lu7ycad7s6laADfnAqCw6wLGI+knxvw9vsIYBaJfYdmeCEG3FMMUiSm3OGgNb+m6utsWf5h9Vw==", + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.20.0.tgz", + "integrity": "sha512-RYbuQuvkhuqVeXweWT3tJLKOEJ/UUw9GjNEZGWdrLLlM+611o1gwLHBpxoFJKKl25fLprp2eVthtKs5JOrNeXg==", "requires": { "tslib": "^1.8.1" } diff --git a/ui/package.json b/ui/package.json index 475fa0474..f292cdaf7 100644 --- a/ui/package.json +++ b/ui/package.json @@ -27,7 +27,7 @@ "@types/react-autosuggest": "10.0.1", "@types/react-dom": "17.0.0", "@types/react-js-pagination": "3.0.3", - "@types/react-select": "3.1.2", + "@types/react-select": "4.0.0", "@typescript-eslint/eslint-plugin": "4.14.0", "@typescript-eslint/parser": "4.14.0", "body-scroll-lock": "3.1.5", @@ -69,7 +69,7 @@ "react-popper": "2.2.4", "react-range": "1.8.6", "react-scripts": "4.0.1", - "react-select": "3.2.0", + "react-select": "4.0.2", "react-transition-group": "4.4.1", "sass": "1.32.5", "typeface-open-sans": "1.1.13", diff --git a/ui/src/Components/MainModal/Configuration/AlertGroupCollapseConfiguration.test.tsx b/ui/src/Components/MainModal/Configuration/AlertGroupCollapseConfiguration.test.tsx index ae6f8905d..39bc89483 100644 --- a/ui/src/Components/MainModal/Configuration/AlertGroupCollapseConfiguration.test.tsx +++ b/ui/src/Components/MainModal/Configuration/AlertGroupCollapseConfiguration.test.tsx @@ -6,19 +6,22 @@ import toDiffableHtml from "diffable-html"; import { MockThemeContext } from "__fixtures__/Theme"; import { Settings } from "Stores/Settings"; +import { ThemeContext } from "Components/Theme"; import { AlertGroupCollapseConfiguration } from "./AlertGroupCollapseConfiguration"; let settingsStore: Settings; beforeEach(() => { settingsStore = new Settings(null); - - jest.spyOn(React, "useContext").mockImplementation(() => MockThemeContext); }); const FakeConfiguration = () => { return mount( - + , + { + wrappingComponent: ThemeContext.Provider, + wrappingComponentProps: { value: MockThemeContext }, + } ); }; diff --git a/ui/src/Components/MainModal/Configuration/AlertGroupSortConfiguration.test.tsx b/ui/src/Components/MainModal/Configuration/AlertGroupSortConfiguration.test.tsx index c2697f72c..27fc139b7 100644 --- a/ui/src/Components/MainModal/Configuration/AlertGroupSortConfiguration.test.tsx +++ b/ui/src/Components/MainModal/Configuration/AlertGroupSortConfiguration.test.tsx @@ -7,14 +7,13 @@ import toDiffableHtml from "diffable-html"; import { MockThemeContext } from "__fixtures__/Theme"; import { useFetchGetMock } from "__fixtures__/useFetchGet"; import { Settings } from "Stores/Settings"; +import { ThemeContext } from "Components/Theme"; import { AlertGroupSortConfiguration } from "./AlertGroupSortConfiguration"; let settingsStore: Settings; beforeEach(() => { settingsStore = new Settings(null); - - jest.spyOn(React, "useContext").mockImplementation(() => MockThemeContext); }); afterEach(() => { @@ -22,7 +21,10 @@ afterEach(() => { }); const FakeConfiguration = () => { - return mount(); + return mount(, { + wrappingComponent: ThemeContext.Provider, + wrappingComponentProps: { value: MockThemeContext }, + }); }; const ExpandSortLabelSuggestions = () => { diff --git a/ui/src/Components/MainModal/Configuration/MultiGridConfiguration.test.tsx b/ui/src/Components/MainModal/Configuration/MultiGridConfiguration.test.tsx index ffeb81386..20b3b626f 100644 --- a/ui/src/Components/MainModal/Configuration/MultiGridConfiguration.test.tsx +++ b/ui/src/Components/MainModal/Configuration/MultiGridConfiguration.test.tsx @@ -9,6 +9,7 @@ import toDiffableHtml from "diffable-html"; import { MockThemeContext } from "__fixtures__/Theme"; import { useFetchGetMock } from "__fixtures__/useFetchGet"; import { Settings } from "Stores/Settings"; +import { ThemeContext } from "Components/Theme"; import { MultiGridConfiguration } from "./MultiGridConfiguration"; let settingsStore: Settings; @@ -19,8 +20,6 @@ beforeEach(() => { }); settingsStore = new Settings(null); - - jest.spyOn(React, "useContext").mockImplementation(() => MockThemeContext); }); afterEach(() => { @@ -28,7 +27,10 @@ afterEach(() => { }); const FakeConfiguration = () => { - return mount(); + return mount(, { + wrappingComponent: ThemeContext.Provider, + wrappingComponentProps: { value: MockThemeContext }, + }); }; const ExpandSortLabelSuggestions = () => { diff --git a/ui/src/Components/MainModal/Configuration/ThemeConfiguration.test.tsx b/ui/src/Components/MainModal/Configuration/ThemeConfiguration.test.tsx index 797c6bb6f..944509c77 100644 --- a/ui/src/Components/MainModal/Configuration/ThemeConfiguration.test.tsx +++ b/ui/src/Components/MainModal/Configuration/ThemeConfiguration.test.tsx @@ -6,18 +6,20 @@ import toDiffableHtml from "diffable-html"; import { MockThemeContext } from "__fixtures__/Theme"; import { Settings, ThemeT } from "Stores/Settings"; +import { ThemeContext } from "Components/Theme"; import { ThemeConfiguration } from "./ThemeConfiguration"; let settingsStore: Settings; beforeEach(() => { settingsStore = new Settings(null); - - jest.spyOn(React, "useContext").mockImplementation(() => MockThemeContext); }); const FakeConfiguration = () => { - return mount(); + return mount(, { + wrappingComponent: ThemeContext.Provider, + wrappingComponentProps: { value: MockThemeContext }, + }); }; describe("", () => { diff --git a/ui/src/Components/MainModal/Configuration/__snapshots__/AlertGroupCollapseConfiguration.test.tsx.snap b/ui/src/Components/MainModal/Configuration/__snapshots__/AlertGroupCollapseConfiguration.test.tsx.snap index 77eb34e55..697a85a86 100644 --- a/ui/src/Components/MainModal/Configuration/__snapshots__/AlertGroupCollapseConfiguration.test.tsx.snap +++ b/ui/src/Components/MainModal/Configuration/__snapshots__/AlertGroupCollapseConfiguration.test.tsx.snap @@ -40,7 +40,7 @@ exports[` matches snapshot with default value viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > diff --git a/ui/src/Components/MainModal/Configuration/__snapshots__/AlertGroupSortConfiguration.test.tsx.snap b/ui/src/Components/MainModal/Configuration/__snapshots__/AlertGroupSortConfiguration.test.tsx.snap index df0fee57e..f9a9c1757 100644 --- a/ui/src/Components/MainModal/Configuration/__snapshots__/AlertGroupSortConfiguration.test.tsx.snap +++ b/ui/src/Components/MainModal/Configuration/__snapshots__/AlertGroupSortConfiguration.test.tsx.snap @@ -42,7 +42,7 @@ exports[` matches snapshot with default values 1` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > diff --git a/ui/src/Components/MainModal/Configuration/__snapshots__/MultiGridConfiguration.test.tsx.snap b/ui/src/Components/MainModal/Configuration/__snapshots__/MultiGridConfiguration.test.tsx.snap index 5ba89e112..9c05bc4df 100644 --- a/ui/src/Components/MainModal/Configuration/__snapshots__/MultiGridConfiguration.test.tsx.snap +++ b/ui/src/Components/MainModal/Configuration/__snapshots__/MultiGridConfiguration.test.tsx.snap @@ -42,7 +42,7 @@ exports[` matches snapshot with default values 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > diff --git a/ui/src/Components/MainModal/Configuration/__snapshots__/ThemeConfiguration.test.tsx.snap b/ui/src/Components/MainModal/Configuration/__snapshots__/ThemeConfiguration.test.tsx.snap index f1dbab258..70c552ee3 100644 --- a/ui/src/Components/MainModal/Configuration/__snapshots__/ThemeConfiguration.test.tsx.snap +++ b/ui/src/Components/MainModal/Configuration/__snapshots__/ThemeConfiguration.test.tsx.snap @@ -40,7 +40,7 @@ exports[` matches snapshot with default values 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > diff --git a/ui/src/Components/MainModal/Configuration/__snapshots__/index.test.tsx.snap b/ui/src/Components/MainModal/Configuration/__snapshots__/index.test.tsx.snap index f11d2ea42..a84582bc7 100644 --- a/ui/src/Components/MainModal/Configuration/__snapshots__/index.test.tsx.snap +++ b/ui/src/Components/MainModal/Configuration/__snapshots__/index.test.tsx.snap @@ -156,7 +156,7 @@ exports[` matches snapshot 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > @@ -353,7 +353,7 @@ exports[` matches snapshot 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > @@ -431,7 +431,7 @@ exports[` matches snapshot 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > @@ -511,7 +511,7 @@ exports[` matches snapshot 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > diff --git a/ui/src/Components/MainModal/__snapshots__/MainModalContent.test.tsx.snap b/ui/src/Components/MainModal/__snapshots__/MainModalContent.test.tsx.snap index 1fcea9f68..62e9ed772 100644 --- a/ui/src/Components/MainModal/__snapshots__/MainModalContent.test.tsx.snap +++ b/ui/src/Components/MainModal/__snapshots__/MainModalContent.test.tsx.snap @@ -175,7 +175,7 @@ exports[` matches snapshot 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > @@ -372,7 +372,7 @@ exports[` matches snapshot 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > @@ -450,7 +450,7 @@ exports[` matches snapshot 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > @@ -530,7 +530,7 @@ exports[` matches snapshot 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > diff --git a/ui/src/Components/NavBar/index.test.tsx b/ui/src/Components/NavBar/index.test.tsx index f8e54c8ab..e95cb29bb 100644 --- a/ui/src/Components/NavBar/index.test.tsx +++ b/ui/src/Components/NavBar/index.test.tsx @@ -7,6 +7,7 @@ import { MockThemeContext } from "__fixtures__/Theme"; import { AlertStore } from "Stores/AlertStore"; import { Settings } from "Stores/Settings"; import { SilenceFormStore } from "Stores/SilenceFormStore"; +import { ThemeContext } from "Components/Theme"; import NavBar from "."; import { MobileIdleTimeout, DesktopIdleTimeout } from "./timeouts"; @@ -19,8 +20,6 @@ declare let global: any; beforeEach(() => { jest.useFakeTimers(); - jest.spyOn(React, "useContext").mockImplementation(() => MockThemeContext); - global.ResizeObserver = jest.fn((cb) => { resizeCallback = cb; return { @@ -52,7 +51,11 @@ const MountedNavbar = (fixedTop?: boolean) => { settingsStore={settingsStore} silenceFormStore={silenceFormStore} fixedTop={fixedTop} - /> + />, + { + wrappingComponent: ThemeContext.Provider, + wrappingComponentProps: { value: MockThemeContext }, + } ); }; diff --git a/ui/src/Components/SilenceModal/AlertManagerInput/__snapshots__/index.test.tsx.snap b/ui/src/Components/SilenceModal/AlertManagerInput/__snapshots__/index.test.tsx.snap index f5efa1b1b..05a6bd23b 100644 --- a/ui/src/Components/SilenceModal/AlertManagerInput/__snapshots__/index.test.tsx.snap +++ b/ui/src/Components/SilenceModal/AlertManagerInput/__snapshots__/index.test.tsx.snap @@ -15,7 +15,7 @@ exports[` matches snapshot 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > @@ -32,7 +32,7 @@ exports[` matches snapshot 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > @@ -68,7 +68,7 @@ exports[` matches snapshot 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > @@ -84,7 +84,7 @@ exports[` matches snapshot 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > diff --git a/ui/src/Components/SilenceModal/AlertManagerInput/index.test.tsx b/ui/src/Components/SilenceModal/AlertManagerInput/index.test.tsx index d92b4f6a3..50d2bdd7e 100644 --- a/ui/src/Components/SilenceModal/AlertManagerInput/index.test.tsx +++ b/ui/src/Components/SilenceModal/AlertManagerInput/index.test.tsx @@ -7,14 +7,13 @@ import toDiffableHtml from "diffable-html"; import { MockThemeContext } from "__fixtures__/Theme"; import { AlertStore } from "Stores/AlertStore"; import { SilenceFormStore } from "Stores/SilenceFormStore"; +import { ThemeContext } from "Components/Theme"; import { AlertManagerInput } from "."; let alertStore: AlertStore; let silenceFormStore: SilenceFormStore; beforeEach(() => { - jest.spyOn(React, "useContext").mockImplementation(() => MockThemeContext); - alertStore = new AlertStore([]); alertStore.data.upstreams.clusters = { HA: ["am1", "am2"], @@ -66,7 +65,11 @@ const MountedAlertManagerInput = () => { + />, + { + wrappingComponent: ThemeContext.Provider, + wrappingComponentProps: { value: MockThemeContext }, + } ); }; diff --git a/ui/src/Components/SilenceModal/AlertManagerInput/index.tsx b/ui/src/Components/SilenceModal/AlertManagerInput/index.tsx index 60d480e23..8aee77bae 100644 --- a/ui/src/Components/SilenceModal/AlertManagerInput/index.tsx +++ b/ui/src/Components/SilenceModal/AlertManagerInput/index.tsx @@ -71,9 +71,7 @@ const AlertManagerInput: FC<{ } isMulti onChange={(newValue) => { - silenceFormStore.data.setAlertmanagers( - (newValue as MultiValueOptionT[]) || ([] as MultiValueOptionT[]) - ); + silenceFormStore.data.setAlertmanagers(newValue as MultiValueOptionT[]); }} isDisabled={silenceFormStore.data.silenceID !== null} /> diff --git a/ui/src/Components/SilenceModal/SilenceForm.test.tsx b/ui/src/Components/SilenceModal/SilenceForm.test.tsx index 005d32ca1..947869ba6 100644 --- a/ui/src/Components/SilenceModal/SilenceForm.test.tsx +++ b/ui/src/Components/SilenceModal/SilenceForm.test.tsx @@ -9,6 +9,7 @@ import { AlertStore, NewUnappliedFilter } from "Stores/AlertStore"; import { Settings } from "Stores/Settings"; import { SilenceFormStore, NewEmptyMatcher } from "Stores/SilenceFormStore"; import { QueryOperators, StaticLabels } from "Common/Query"; +import { ThemeContext } from "Components/Theme"; import SilenceForm from "./SilenceForm"; let alertStore: AlertStore; @@ -16,8 +17,6 @@ let settingsStore: Settings; let silenceFormStore: SilenceFormStore; beforeEach(() => { - jest.spyOn(React, "useContext").mockImplementation(() => MockThemeContext); - alertStore = new AlertStore([]); settingsStore = new Settings(null); silenceFormStore = new SilenceFormStore(); @@ -48,7 +47,11 @@ const MountedSilenceForm = () => { silenceFormStore={silenceFormStore} settingsStore={settingsStore} previewOpen={false} - /> + />, + { + wrappingComponent: ThemeContext.Provider, + wrappingComponentProps: { value: MockThemeContext }, + } ); }; diff --git a/ui/src/Components/SilenceModal/SilenceMatch/LabelNameInput.test.tsx b/ui/src/Components/SilenceModal/SilenceMatch/LabelNameInput.test.tsx index 85daacc86..624e2114e 100644 --- a/ui/src/Components/SilenceModal/SilenceMatch/LabelNameInput.test.tsx +++ b/ui/src/Components/SilenceModal/SilenceMatch/LabelNameInput.test.tsx @@ -7,14 +7,13 @@ import toDiffableHtml from "diffable-html"; import { MockThemeContext } from "__fixtures__/Theme"; import { useFetchGetMock } from "__fixtures__/useFetchGet"; import { NewEmptyMatcher, MatcherWithIDT } from "Stores/SilenceFormStore"; +import { ThemeContext } from "Components/Theme"; import { useFetchGet } from "Hooks/useFetchGet"; import { LabelNameInput } from "./LabelNameInput"; let matcher: MatcherWithIDT; beforeEach(() => { - jest.spyOn(React, "useContext").mockImplementation(() => MockThemeContext); - matcher = NewEmptyMatcher(); matcher.name = "cluster"; }); @@ -25,7 +24,10 @@ afterEach(() => { }); const MountedLabelNameInput = (isValid: boolean) => { - return mount(); + return mount(, { + wrappingComponent: ThemeContext.Provider, + wrappingComponentProps: { value: MockThemeContext }, + }); }; describe("", () => { diff --git a/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.test.tsx b/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.test.tsx index 82839ee28..b57ba39eb 100644 --- a/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.test.tsx +++ b/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.test.tsx @@ -11,6 +11,7 @@ import { NewEmptyMatcher, MatcherWithIDT, } from "Stores/SilenceFormStore"; +import { ThemeContext } from "Components/Theme"; import { StringToOption } from "Common/Select"; import { LabelValueInput } from "./LabelValueInput"; @@ -18,8 +19,6 @@ let silenceFormStore: SilenceFormStore; let matcher: MatcherWithIDT; beforeEach(() => { - jest.spyOn(React, "useContext").mockImplementation(() => MockThemeContext); - silenceFormStore = new SilenceFormStore(); matcher = NewEmptyMatcher(); matcher.name = "cluster"; @@ -35,7 +34,11 @@ const MountedLabelValueInput = (isValid: boolean) => { silenceFormStore={silenceFormStore} matcher={matcher} isValid={isValid} - /> + />, + { + wrappingComponent: ThemeContext.Provider, + wrappingComponentProps: { value: MockThemeContext }, + } ); }; diff --git a/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.tsx b/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.tsx index 41d2729a5..1285e03a9 100644 --- a/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.tsx +++ b/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.tsx @@ -97,7 +97,7 @@ const LabelValueInput: FC<{ } placeholder={isValid ? "Label value" : } onChange={(newValue) => { - matcher.values = (newValue || []) as OptionT[]; + matcher.values = newValue as OptionT[]; // force regex if we have multiple values if (matcher.values.length > 1 && matcher.isRegex === false) { matcher.isRegex = true; diff --git a/ui/src/Components/SilenceModal/SilenceMatch/__snapshots__/LabelNameInput.test.tsx.snap b/ui/src/Components/SilenceModal/SilenceMatch/__snapshots__/LabelNameInput.test.tsx.snap index 6443b5c16..c6ed68e5d 100644 --- a/ui/src/Components/SilenceModal/SilenceMatch/__snapshots__/LabelNameInput.test.tsx.snap +++ b/ui/src/Components/SilenceModal/SilenceMatch/__snapshots__/LabelNameInput.test.tsx.snap @@ -39,7 +39,7 @@ exports[` matches snapshot 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > diff --git a/ui/src/Components/SilenceModal/SilenceMatch/__snapshots__/LabelValueInput.test.tsx.snap b/ui/src/Components/SilenceModal/SilenceMatch/__snapshots__/LabelValueInput.test.tsx.snap index 9501e83c6..1f8bbdbcd 100644 --- a/ui/src/Components/SilenceModal/SilenceMatch/__snapshots__/LabelValueInput.test.tsx.snap +++ b/ui/src/Components/SilenceModal/SilenceMatch/__snapshots__/LabelValueInput.test.tsx.snap @@ -41,7 +41,7 @@ exports[` fetches suggestions on mount 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > @@ -94,7 +94,7 @@ exports[` matches snapshot 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > diff --git a/ui/src/Components/SilenceModal/SilenceModalContent.test.tsx b/ui/src/Components/SilenceModal/SilenceModalContent.test.tsx index 768c31b75..fce112cd7 100644 --- a/ui/src/Components/SilenceModal/SilenceModalContent.test.tsx +++ b/ui/src/Components/SilenceModal/SilenceModalContent.test.tsx @@ -8,6 +8,7 @@ import { MockThemeContext } from "__fixtures__/Theme"; import { AlertStore } from "Stores/AlertStore"; import { Settings } from "Stores/Settings"; import { SilenceFormStore } from "Stores/SilenceFormStore"; +import { ThemeContext } from "Components/Theme"; import { SilenceModalContent } from "./SilenceModalContent"; let alertStore: AlertStore; @@ -15,8 +16,6 @@ let settingsStore: Settings; let silenceFormStore: SilenceFormStore; beforeEach(() => { - jest.spyOn(React, "useContext").mockImplementation(() => MockThemeContext); - alertStore = new AlertStore([]); settingsStore = new Settings(null); silenceFormStore = new SilenceFormStore(); @@ -56,7 +55,11 @@ const MountedSilenceModalContent = () => { settingsStore={settingsStore} silenceFormStore={silenceFormStore} onHide={MockOnHide} - /> + />, + { + wrappingComponent: ThemeContext.Provider, + wrappingComponentProps: { value: MockThemeContext }, + } ); }; diff --git a/ui/src/Components/Theme/__snapshots__/ReactSelect.test.tsx.snap b/ui/src/Components/Theme/__snapshots__/ReactSelect.test.tsx.snap index 7e1ea81e8..72d127513 100644 --- a/ui/src/Components/Theme/__snapshots__/ReactSelect.test.tsx.snap +++ b/ui/src/Components/Theme/__snapshots__/ReactSelect.test.tsx.snap @@ -4,7 +4,7 @@ exports[` matches snapshot when focused 1`] = ` "
  @@ -49,7 +49,7 @@ exports[` matches snapshot when focused 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > @@ -65,7 +65,7 @@ exports[` matches snapshot when focused and disabled "
  @@ -111,7 +111,7 @@ exports[` matches snapshot when focused and disabled viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > @@ -162,7 +162,7 @@ exports[` matches snapshot with a value 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > @@ -214,7 +214,7 @@ exports[` matches snapshot with isDisabled=true 1`] viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > @@ -265,7 +265,7 @@ exports[` matches snapshot with isMulti=true 1`] = ` viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > @@ -292,7 +292,7 @@ exports[` matches snapshot with isMulti=true and a v viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > @@ -328,7 +328,7 @@ exports[` matches snapshot with isMulti=true and a v viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" > @@ -344,7 +344,7 @@ exports[` matches snapshot with isMulti=true and a v viewbox=\\"0 0 20 20\\" aria-hidden=\\"true\\" focusable=\\"false\\" - class=\\"css-6q0nyr-Svg\\" + class=\\"css-tj5bde-Svg\\" >