diff --git a/package.json b/package.json index aaa893fc1..d77a2f338 100644 --- a/package.json +++ b/package.json @@ -60,22 +60,19 @@ "classnames": "2.2.6", "clone-deep": "4.0.1", "d3": "6.3.0", - "enzyme": "3.11.0", - "enzyme-adapter-react-16": "1.15.5", - "enzyme-to-json": "3.6.1", "framer-motion": "2.9.5", "immer": "8.0.0", "mock-socket": "^9.0.3", "node-sass": "4.14.1", "prop-types": "15.7.2", "query-string": "6.13.7", - "react": "16.14.0", - "react-dom": "16.14.0", + "react": "17.0.1", + "react-dom": "17.0.1", "react-ga": "3.3.0", "react-redux": "7.2.2", "react-router-dom": "5.2.0", "react-scripts": "4.0.1", - "react-test-renderer": "16.14.0", + "react-test-renderer": "17.0.1", "redux": "4.0.5", "redux-devtools-extension": "2.13.8", "redux-mock-store": "1.5.4", @@ -92,6 +89,9 @@ "@types/react": "17.0.0", "@types/react-dom": "17.0.0", "eslint-config-prettier": "7.0.0", + "@wojtekmaj/enzyme-adapter-react-17": "0.1.1", + "enzyme": "3.11.0", + "enzyme-to-json": "3.6.1", "eslint-plugin-import": "2.22.1", "eslint-plugin-jest": "24.1.3", "eslint-plugin-jsx-a11y": "6.4.1", diff --git a/src/app/utils.js b/src/app/utils.js index becf07c49..61bb43863 100644 --- a/src/app/utils.js +++ b/src/app/utils.js @@ -1,4 +1,3 @@ -import React from "react"; import cloneDeep from "clone-deep"; import defaultCharmIcon from "static/images/icons/default-charm-icon.svg"; diff --git a/src/components/App/App.js b/src/components/App/App.js index c64a1c552..4703b3895 100644 --- a/src/components/App/App.js +++ b/src/components/App/App.js @@ -1,4 +1,3 @@ -import React from "react"; import { useSelector } from "react-redux"; import { BrowserRouter as Router, Route } from "react-router-dom"; import { QueryParamProvider } from "use-query-params"; diff --git a/src/components/App/App.test.js b/src/components/App/App.test.js index 9d5398e45..7de853e81 100644 --- a/src/components/App/App.test.js +++ b/src/components/App/App.test.js @@ -1,4 +1,3 @@ -import React from "react"; import { Provider } from "react-redux"; import configureStore from "redux-mock-store"; import { mount } from "enzyme"; diff --git a/src/components/DonutChart/DonutChart.js b/src/components/DonutChart/DonutChart.js index 25fb20719..08e4ef122 100644 --- a/src/components/DonutChart/DonutChart.js +++ b/src/components/DonutChart/DonutChart.js @@ -1,4 +1,4 @@ -import React, { useRef, useEffect } from "react"; +import { useRef, useEffect } from "react"; import * as d3 from "d3"; const DonutChart = ({ chartData }) => { diff --git a/src/components/DonutChart/DonutChart.test.js b/src/components/DonutChart/DonutChart.test.js index 34df21333..9b6e4c917 100644 --- a/src/components/DonutChart/DonutChart.test.js +++ b/src/components/DonutChart/DonutChart.test.js @@ -1,4 +1,3 @@ -import React from "react"; import { mount } from "enzyme"; import DonutChart from "./DonutChart"; diff --git a/src/components/ErrorBoundary/ErrorBoundary.js b/src/components/ErrorBoundary/ErrorBoundary.js index 7c2e1ddb3..9dddf1eab 100644 --- a/src/components/ErrorBoundary/ErrorBoundary.js +++ b/src/components/ErrorBoundary/ErrorBoundary.js @@ -1,4 +1,4 @@ -import React, { Component } from "react"; +import { Component } from "react"; import * as Sentry from "@sentry/browser"; export default class ErrorBoundary extends Component { diff --git a/src/components/ErrorBoundary/ErrorBoundary.test.js b/src/components/ErrorBoundary/ErrorBoundary.test.js index 0d0e5672a..857df7f4f 100644 --- a/src/components/ErrorBoundary/ErrorBoundary.test.js +++ b/src/components/ErrorBoundary/ErrorBoundary.test.js @@ -1,4 +1,3 @@ -import React from "react"; import { mount } from "enzyme"; import ErrorBoundary from "./ErrorBoundary"; diff --git a/src/components/Filter/Filter.js b/src/components/Filter/Filter.js index 2a8fa1106..aac631966 100644 --- a/src/components/Filter/Filter.js +++ b/src/components/Filter/Filter.js @@ -1,4 +1,3 @@ -import React from "react"; import Button from "components/Button/Button"; import classNames from "classnames"; diff --git a/src/components/Filter/Filter.test.js b/src/components/Filter/Filter.test.js index c3841c7d4..47948348d 100644 --- a/src/components/Filter/Filter.test.js +++ b/src/components/Filter/Filter.test.js @@ -1,4 +1,3 @@ -import React from "react"; import { mount } from "enzyme"; import Filter from "./Filter"; diff --git a/src/components/Header/Header.js b/src/components/Header/Header.js index f2a2e57a3..21cf032e0 100644 --- a/src/components/Header/Header.js +++ b/src/components/Header/Header.js @@ -1,5 +1,3 @@ -import React from "react"; - import "./_header.scss"; export default function Header({ children }) { diff --git a/src/components/Header/Header.test.js b/src/components/Header/Header.test.js index 7ce440d7c..463aba328 100644 --- a/src/components/Header/Header.test.js +++ b/src/components/Header/Header.test.js @@ -1,4 +1,3 @@ -import React from "react"; import { mount } from "enzyme"; import Header from "./Header"; diff --git a/src/components/InfoPanel/InfoPanel.js b/src/components/InfoPanel/InfoPanel.js index 262338910..704f7e22b 100644 --- a/src/components/InfoPanel/InfoPanel.js +++ b/src/components/InfoPanel/InfoPanel.js @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import { useState } from "react"; import { useParams } from "react-router-dom"; import Topology from "components/Topology/Topology"; diff --git a/src/components/InfoPanel/InfoPanel.test.js b/src/components/InfoPanel/InfoPanel.test.js index ec99080fa..76edee212 100644 --- a/src/components/InfoPanel/InfoPanel.test.js +++ b/src/components/InfoPanel/InfoPanel.test.js @@ -1,4 +1,3 @@ -import React from "react"; import configureStore from "redux-mock-store"; import { Provider } from "react-redux"; import { mount } from "enzyme"; diff --git a/src/components/Layout/Layout.js b/src/components/Layout/Layout.js index 77294517e..3dc7403c1 100644 --- a/src/components/Layout/Layout.js +++ b/src/components/Layout/Layout.js @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import { useState } from "react"; import { useSelector, useStore } from "react-redux"; import { isLoggedIn, getWSControllerURL } from "app/selectors"; import Notification from "@canonical/react-components/dist/components/Notification/Notification"; diff --git a/src/components/Layout/Layout.test.js b/src/components/Layout/Layout.test.js index e88ac129d..8e4f229da 100644 --- a/src/components/Layout/Layout.test.js +++ b/src/components/Layout/Layout.test.js @@ -1,4 +1,3 @@ -import React from "react"; import { BrowserRouter as Router } from "react-router-dom"; import { mount } from "enzyme"; import configureStore from "redux-mock-store"; diff --git a/src/components/LogIn/LogIn.js b/src/components/LogIn/LogIn.js index 35b583eea..7b6d8156c 100644 --- a/src/components/LogIn/LogIn.js +++ b/src/components/LogIn/LogIn.js @@ -1,4 +1,4 @@ -import React, { useEffect, useRef } from "react"; +import { useEffect, useRef } from "react"; import { useDispatch, useSelector, useStore } from "react-redux"; import { isLoggedIn, diff --git a/src/components/LogIn/LogIn.test.js b/src/components/LogIn/LogIn.test.js index 4728849b5..91d1d7677 100644 --- a/src/components/LogIn/LogIn.test.js +++ b/src/components/LogIn/LogIn.test.js @@ -1,4 +1,3 @@ -import React from "react"; import configureStore from "redux-mock-store"; import { Provider } from "react-redux"; import { mount } from "enzyme"; diff --git a/src/components/Logo/Logo.js b/src/components/Logo/Logo.js index a095267b9..cb0321b7a 100644 --- a/src/components/Logo/Logo.js +++ b/src/components/Logo/Logo.js @@ -1,4 +1,3 @@ -import React from "react"; import { useSelector } from "react-redux"; import { getConfig } from "app/selectors"; diff --git a/src/components/ModelTableList/CloudGroup.js b/src/components/ModelTableList/CloudGroup.js index e02d393c6..c0438cf7f 100644 --- a/src/components/ModelTableList/CloudGroup.js +++ b/src/components/ModelTableList/CloudGroup.js @@ -1,4 +1,3 @@ -import React from "react"; import { useSelector } from "react-redux"; import MainTable from "@canonical/react-components/dist/components/MainTable"; import { diff --git a/src/components/ModelTableList/CloudGroup.test.js b/src/components/ModelTableList/CloudGroup.test.js index 3e254711d..4099eb7e6 100644 --- a/src/components/ModelTableList/CloudGroup.test.js +++ b/src/components/ModelTableList/CloudGroup.test.js @@ -1,4 +1,3 @@ -import React from "react"; import { MemoryRouter } from "react-router"; import { mount } from "enzyme"; import { Provider } from "react-redux"; diff --git a/src/components/ModelTableList/ModelTableList.js b/src/components/ModelTableList/ModelTableList.js index 1b04fa214..c3384279a 100644 --- a/src/components/ModelTableList/ModelTableList.js +++ b/src/components/ModelTableList/ModelTableList.js @@ -1,4 +1,3 @@ -import React from "react"; import { useSelector, useStore } from "react-redux"; import { getActiveUserTag, getWSControllerURL } from "app/selectors"; diff --git a/src/components/ModelTableList/ModelTableList.test.js b/src/components/ModelTableList/ModelTableList.test.js index 53f98e9d0..989f59df2 100644 --- a/src/components/ModelTableList/ModelTableList.test.js +++ b/src/components/ModelTableList/ModelTableList.test.js @@ -1,4 +1,3 @@ -import React from "react"; import cloneDeep from "clone-deep"; import { MemoryRouter } from "react-router"; import { mount } from "enzyme"; diff --git a/src/components/ModelTableList/OwnerGroup.js b/src/components/ModelTableList/OwnerGroup.js index 28203199d..90dc7cfe7 100644 --- a/src/components/ModelTableList/OwnerGroup.js +++ b/src/components/ModelTableList/OwnerGroup.js @@ -1,4 +1,3 @@ -import React from "react"; import { useSelector } from "react-redux"; import MainTable from "@canonical/react-components/dist/components/MainTable"; import { generateStatusElement, getModelStatusGroupData } from "app/utils"; diff --git a/src/components/ModelTableList/OwnerGroup.test.js b/src/components/ModelTableList/OwnerGroup.test.js index 80315277c..2c14b4fca 100644 --- a/src/components/ModelTableList/OwnerGroup.test.js +++ b/src/components/ModelTableList/OwnerGroup.test.js @@ -1,4 +1,3 @@ -import React from "react"; import { MemoryRouter } from "react-router"; import { mount } from "enzyme"; import { Provider } from "react-redux"; diff --git a/src/components/ModelTableList/StatusGroup.js b/src/components/ModelTableList/StatusGroup.js index 1ce5830cc..4d7ee84b7 100644 --- a/src/components/ModelTableList/StatusGroup.js +++ b/src/components/ModelTableList/StatusGroup.js @@ -1,4 +1,3 @@ -import React from "react"; import { useSelector } from "react-redux"; import MainTable from "@canonical/react-components/dist/components/MainTable"; diff --git a/src/components/ModelTableList/StatusGroup.test.js b/src/components/ModelTableList/StatusGroup.test.js index 41186d744..49f3adca2 100644 --- a/src/components/ModelTableList/StatusGroup.test.js +++ b/src/components/ModelTableList/StatusGroup.test.js @@ -1,4 +1,3 @@ -import React from "react"; import { MemoryRouter } from "react-router"; import { mount } from "enzyme"; import { Provider } from "react-redux"; diff --git a/src/components/ModelTableList/shared.js b/src/components/ModelTableList/shared.js index 62fed41c1..cd5a4422b 100644 --- a/src/components/ModelTableList/shared.js +++ b/src/components/ModelTableList/shared.js @@ -1,4 +1,3 @@ -import React from "react"; import { Link } from "react-router-dom"; import { extractCloudName, extractCredentialName } from "app/utils"; diff --git a/src/components/PrimaryNav/PrimaryNav.js b/src/components/PrimaryNav/PrimaryNav.js index 7b89f7c6c..98de564d2 100644 --- a/src/components/PrimaryNav/PrimaryNav.js +++ b/src/components/PrimaryNav/PrimaryNav.js @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from "react"; +import { useState, useEffect } from "react"; import { useSelector } from "react-redux"; import { NavLink, useLocation } from "react-router-dom"; diff --git a/src/components/PrimaryNav/PrimaryNav.test.js b/src/components/PrimaryNav/PrimaryNav.test.js index 06c9408f6..a64ce5628 100644 --- a/src/components/PrimaryNav/PrimaryNav.test.js +++ b/src/components/PrimaryNav/PrimaryNav.test.js @@ -1,4 +1,3 @@ -import React from "react"; import { MemoryRouter } from "react-router-dom"; import { mount } from "enzyme"; import configureStore from "redux-mock-store"; diff --git a/src/components/Routes/Routes.js b/src/components/Routes/Routes.js index 099e3de02..ecbe3f87d 100644 --- a/src/components/Routes/Routes.js +++ b/src/components/Routes/Routes.js @@ -1,4 +1,4 @@ -import React, { useEffect } from "react"; +import { useEffect } from "react"; import { Route, Redirect, Switch, useLocation } from "react-router-dom"; import Login from "components/LogIn/LogIn"; diff --git a/src/components/Routes/TestRoute.js b/src/components/Routes/TestRoute.js index 44a56f617..b71abbdcc 100644 --- a/src/components/Routes/TestRoute.js +++ b/src/components/Routes/TestRoute.js @@ -1,4 +1,3 @@ -import React from "react"; import { Route } from "react-router-dom"; import { paths } from "./Routes"; diff --git a/src/components/SlidePanel/SlidePanel.js b/src/components/SlidePanel/SlidePanel.js index c16c4ce95..b95787afd 100644 --- a/src/components/SlidePanel/SlidePanel.js +++ b/src/components/SlidePanel/SlidePanel.js @@ -1,4 +1,3 @@ -import React from "react"; import classnames from "classnames"; import Spinner from "@canonical/react-components/dist/components/Spinner"; diff --git a/src/components/SlidePanel/SlidePanel.test.js b/src/components/SlidePanel/SlidePanel.test.js index 6c3cbf8aa..8fa666029 100644 --- a/src/components/SlidePanel/SlidePanel.test.js +++ b/src/components/SlidePanel/SlidePanel.test.js @@ -1,4 +1,3 @@ -import React from "react"; import { shallow, mount } from "enzyme"; import SlidePanel from "./SlidePanel"; diff --git a/src/components/StatusStrip/StatusStrip.js b/src/components/StatusStrip/StatusStrip.js index 996bc001f..59e8b03e2 100644 --- a/src/components/StatusStrip/StatusStrip.js +++ b/src/components/StatusStrip/StatusStrip.js @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from "react"; +import { useState, useEffect } from "react"; import { pluralize } from "app/utils"; import "./_status-strip.scss"; diff --git a/src/components/StatusStrip/StatusStrip.test.js b/src/components/StatusStrip/StatusStrip.test.js index e8ff26ef1..adb4a64ff 100644 --- a/src/components/StatusStrip/StatusStrip.test.js +++ b/src/components/StatusStrip/StatusStrip.test.js @@ -1,4 +1,3 @@ -import React from "react"; import { mount } from "enzyme"; import StatusStrip from "./StatusStrip"; diff --git a/src/components/Topology/Topology.js b/src/components/Topology/Topology.js index dc39f0cf6..3151ba6b7 100644 --- a/src/components/Topology/Topology.js +++ b/src/components/Topology/Topology.js @@ -1,4 +1,4 @@ -import React, { useRef, useEffect } from "react"; +import { useRef, useEffect } from "react"; import * as d3 from "d3"; import { generateIconPath } from "app/utils"; diff --git a/src/components/UserMenu/UserMenu.js b/src/components/UserMenu/UserMenu.js index 19c3e056d..8d26045b1 100644 --- a/src/components/UserMenu/UserMenu.js +++ b/src/components/UserMenu/UserMenu.js @@ -1,4 +1,4 @@ -import React, { useEffect } from "react"; +import { useEffect } from "react"; import { useSelector, useDispatch, useStore } from "react-redux"; import { Link, NavLink } from "react-router-dom"; import classNames from "classnames"; diff --git a/src/components/UserMenu/UserMenu.test.js b/src/components/UserMenu/UserMenu.test.js index 910ce5713..9f2c01951 100644 --- a/src/components/UserMenu/UserMenu.test.js +++ b/src/components/UserMenu/UserMenu.test.js @@ -1,4 +1,3 @@ -import React from "react"; import { BrowserRouter as Router } from "react-router-dom"; import configureStore from "redux-mock-store"; import { Provider } from "react-redux"; diff --git a/src/components/WebCLI/Output.js b/src/components/WebCLI/Output.js index c53342d20..7503ea16e 100644 --- a/src/components/WebCLI/Output.js +++ b/src/components/WebCLI/Output.js @@ -1,4 +1,4 @@ -import React, { useEffect, useMemo, useRef, useState } from "react"; +import { useEffect, useMemo, useRef, useState } from "react"; // Colors taken from the VSCode section of // https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit diff --git a/src/components/WebCLI/WebCLI.js b/src/components/WebCLI/WebCLI.js index 3249baa5f..1d7eee1d4 100644 --- a/src/components/WebCLI/WebCLI.js +++ b/src/components/WebCLI/WebCLI.js @@ -1,4 +1,4 @@ -import React, { useEffect, useMemo, useRef, useState } from "react"; +import { useEffect, useMemo, useRef, useState } from "react"; import useAnalytics from "../../hooks/useAnalytics"; diff --git a/src/components/WebCLI/WebCLI.test.js b/src/components/WebCLI/WebCLI.test.js index 4b8d96fea..78a6d1c6b 100644 --- a/src/components/WebCLI/WebCLI.test.js +++ b/src/components/WebCLI/WebCLI.test.js @@ -1,4 +1,3 @@ -import React from "react"; import { mount } from "enzyme"; import { act } from "react-dom/test-utils"; import WS from "jest-websocket-mock"; diff --git a/src/components/panels/AppsPanel/AppsPanel.js b/src/components/panels/AppsPanel/AppsPanel.js index dc5a54fad..a1bbf9adb 100644 --- a/src/components/panels/AppsPanel/AppsPanel.js +++ b/src/components/panels/AppsPanel/AppsPanel.js @@ -1,4 +1,4 @@ -import React, { useMemo } from "react"; +import { useMemo } from "react"; import { useSelector } from "react-redux"; import { getConfig } from "app/selectors"; import MainTable from "@canonical/react-components/dist/components/MainTable"; diff --git a/src/components/panels/MachinesPanel/MachinesPanel.js b/src/components/panels/MachinesPanel/MachinesPanel.js index e5057fceb..776bfe455 100644 --- a/src/components/panels/MachinesPanel/MachinesPanel.js +++ b/src/components/panels/MachinesPanel/MachinesPanel.js @@ -1,4 +1,4 @@ -import React, { useMemo, useCallback } from "react"; +import { useMemo, useCallback } from "react"; import MainTable from "@canonical/react-components/dist/components/MainTable"; import cloneDeep from "clone-deep"; diff --git a/src/components/panels/UnitsPanel/UnitsPanel.js b/src/components/panels/UnitsPanel/UnitsPanel.js index 7ced41c1e..1a9c0f0e8 100644 --- a/src/components/panels/UnitsPanel/UnitsPanel.js +++ b/src/components/panels/UnitsPanel/UnitsPanel.js @@ -1,4 +1,4 @@ -import React, { useMemo, useCallback } from "react"; +import { useMemo, useCallback } from "react"; import MainTable from "@canonical/react-components/dist/components/MainTable"; import cloneDeep from "clone-deep"; diff --git a/src/index.js b/src/index.js index 0f2f407f6..146ea68ce 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,4 @@ -import React from "react"; +import { StrictMode } from "react"; import ReactDOM from "react-dom"; import { Provider } from "react-redux"; import { applyMiddleware, combineReducers, createStore } from "redux"; @@ -103,9 +103,9 @@ function bootstrap() { ReactDOM.render( - + - + , rootElement ); diff --git a/src/pages/Controllers/ControllerChart/ControllerChart.js b/src/pages/Controllers/ControllerChart/ControllerChart.js index 31edea510..c4ab588a2 100644 --- a/src/pages/Controllers/ControllerChart/ControllerChart.js +++ b/src/pages/Controllers/ControllerChart/ControllerChart.js @@ -1,5 +1,3 @@ -import React from "react"; - import DonutChart from "components/DonutChart/DonutChart"; import { pluralize } from "app/utils"; diff --git a/src/pages/Controllers/ControllerChart/ControllerChart.test.js b/src/pages/Controllers/ControllerChart/ControllerChart.test.js index 6fecb92ca..53217e6da 100644 --- a/src/pages/Controllers/ControllerChart/ControllerChart.test.js +++ b/src/pages/Controllers/ControllerChart/ControllerChart.test.js @@ -1,4 +1,3 @@ -import React from "react"; import { mount } from "enzyme"; import ControllerChart from "./ControllerChart"; diff --git a/src/pages/Controllers/ControllerOverview/ControllerOverview.js b/src/pages/Controllers/ControllerOverview/ControllerOverview.js index a52ce52d1..ae9963391 100644 --- a/src/pages/Controllers/ControllerOverview/ControllerOverview.js +++ b/src/pages/Controllers/ControllerOverview/ControllerOverview.js @@ -1,4 +1,3 @@ -import React from "react"; import { useSelector } from "react-redux"; import { diff --git a/src/pages/Controllers/Controllers.js b/src/pages/Controllers/Controllers.js index 31825802f..c9db735be 100644 --- a/src/pages/Controllers/Controllers.js +++ b/src/pages/Controllers/Controllers.js @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import { useState } from "react"; import { useDispatch, useSelector, useStore } from "react-redux"; import { Link } from "react-router-dom"; import cloneDeep from "clone-deep"; diff --git a/src/pages/Controllers/Controllers.test.js b/src/pages/Controllers/Controllers.test.js index 1c7989a4b..7c5ea83d9 100644 --- a/src/pages/Controllers/Controllers.test.js +++ b/src/pages/Controllers/Controllers.test.js @@ -1,4 +1,3 @@ -import React from "react"; import cloneDeep from "clone-deep"; import { mount } from "enzyme"; import { MemoryRouter } from "react-router"; diff --git a/src/pages/Models/Details/ModelDetails.js b/src/pages/Models/Details/ModelDetails.js index 91682f972..a4d89e85f 100644 --- a/src/pages/Models/Details/ModelDetails.js +++ b/src/pages/Models/Details/ModelDetails.js @@ -1,4 +1,4 @@ -import React, { useEffect, useMemo, useState, useCallback } from "react"; +import { useEffect, useMemo, useState, useCallback } from "react"; import MainTable from "@canonical/react-components/dist/components/MainTable"; import Spinner from "@canonical/react-components/dist/components/Spinner"; import { useDispatch, useSelector, useStore } from "react-redux"; diff --git a/src/pages/Models/Details/ModelDetails.test.js b/src/pages/Models/Details/ModelDetails.test.js index c7350bf21..fa6d3c630 100644 --- a/src/pages/Models/Details/ModelDetails.test.js +++ b/src/pages/Models/Details/ModelDetails.test.js @@ -1,4 +1,3 @@ -import React from "react"; import configureStore from "redux-mock-store"; import { Provider } from "react-redux"; import { mount } from "enzyme"; diff --git a/src/pages/Models/Details/generators.js b/src/pages/Models/Details/generators.js index 8bf8057d1..2a1f43c93 100644 --- a/src/pages/Models/Details/generators.js +++ b/src/pages/Models/Details/generators.js @@ -1,4 +1,3 @@ -import React from "react"; import { URL } from "@canonical/jaaslib/lib/urls"; import cloneDeep from "clone-deep"; diff --git a/src/pages/Models/Models.js b/src/pages/Models/Models.js index 9892a3950..4de515112 100644 --- a/src/pages/Models/Models.js +++ b/src/pages/Models/Models.js @@ -1,4 +1,3 @@ -import React from "react"; import { useSelector } from "react-redux"; import Spinner from "@canonical/react-components/dist/components/Spinner"; diff --git a/src/pages/Models/Models.test.js b/src/pages/Models/Models.test.js index dc527411b..ee741fbee 100644 --- a/src/pages/Models/Models.test.js +++ b/src/pages/Models/Models.test.js @@ -1,4 +1,3 @@ -import React from "react"; import configureStore from "redux-mock-store"; import { Provider } from "react-redux"; import { mount } from "enzyme"; diff --git a/src/pages/NotFound/NotFound.js b/src/pages/NotFound/NotFound.js index 3b1d5e1e8..9a4caf9d7 100644 --- a/src/pages/NotFound/NotFound.js +++ b/src/pages/NotFound/NotFound.js @@ -1,4 +1,3 @@ -import React from "react"; import { Link } from "react-router-dom"; import Layout from "components/Layout/Layout"; diff --git a/src/pages/NotFound/NotFound.test.js b/src/pages/NotFound/NotFound.test.js index 1066334eb..a171faa09 100644 --- a/src/pages/NotFound/NotFound.test.js +++ b/src/pages/NotFound/NotFound.test.js @@ -1,4 +1,3 @@ -import React from "react"; import configureStore from "redux-mock-store"; import { Provider } from "react-redux"; import { mount } from "enzyme"; diff --git a/src/pages/Settings/Settings.js b/src/pages/Settings/Settings.js index 12c5d2d71..d30d2a356 100644 --- a/src/pages/Settings/Settings.js +++ b/src/pages/Settings/Settings.js @@ -1,4 +1,3 @@ -import React from "react"; import Header from "components/Header/Header"; import Layout from "components/Layout/Layout"; diff --git a/src/setupTests.js b/src/setupTests.js index 239aebcab..ef4a97980 100644 --- a/src/setupTests.js +++ b/src/setupTests.js @@ -1,5 +1,5 @@ import { configure } from "enzyme"; -import Adapter from "enzyme-adapter-react-16"; +import Adapter from "@wojtekmaj/enzyme-adapter-react-17"; configure({ adapter: new Adapter() }); diff --git a/src/testing/utils.js b/src/testing/utils.js index b63fe6b98..5e3101c78 100644 --- a/src/testing/utils.js +++ b/src/testing/utils.js @@ -1,4 +1,3 @@ -import React from "react"; import { shallow } from "enzyme"; /** diff --git a/yarn.lock b/yarn.lock index 94626ca31..44eecde5e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2273,6 +2273,21 @@ "@webassemblyjs/wast-parser" "1.9.0" "@xtuc/long" "4.2.2" +"@wojtekmaj/enzyme-adapter-react-17@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@wojtekmaj/enzyme-adapter-react-17/-/enzyme-adapter-react-17-0.1.1.tgz#f682bb4ead004cd28660b243779c8ede6a053a49" + integrity sha512-LFQXbtz2SeiSc+TGv5F59WVSONiBI3U8y+xw49rbJJV08GndsWJ3BKjOooYy52z5Z93L33pPgmAOuijVl2wuLQ== + dependencies: + enzyme-adapter-utils "^1.13.1" + enzyme-shallow-equal "^1.0.4" + has "^1.0.3" + object.assign "^4.1.0" + object.values "^1.1.1" + prop-types "^15.7.2" + react-is "^16.13.1" + react-test-renderer "^17.0.0-0" + semver "^5.7.0" + "@xtuc/ieee754@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" @@ -4925,21 +4940,6 @@ entities@^2.0.0: resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== -enzyme-adapter-react-16@1.15.5: - version "1.15.5" - resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.15.5.tgz#7a6f0093d3edd2f7025b36e7fbf290695473ee04" - integrity sha512-33yUJGT1nHFQlbVI5qdo5Pfqvu/h4qPwi1o0a6ZZsjpiqq92a3HjynDhwd1IeED+Su60HDWV8mxJqkTnLYdGkw== - dependencies: - enzyme-adapter-utils "^1.13.1" - enzyme-shallow-equal "^1.0.4" - has "^1.0.3" - object.assign "^4.1.0" - object.values "^1.1.1" - prop-types "^15.7.2" - react-is "^16.13.1" - react-test-renderer "^16.0.0-0" - semver "^5.7.0" - enzyme-adapter-utils@^1.13.1: version "1.13.1" resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.13.1.tgz#59c1b734b0927543e3d8dc477299ec957feb312d" @@ -10462,15 +10462,14 @@ react-dev-utils@^11.0.1: strip-ansi "6.0.0" text-table "0.2.0" -react-dom@16.14.0: - version "16.14.0" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.14.0.tgz#7ad838ec29a777fb3c75c3a190f661cf92ab8b89" - integrity sha512-1gCeQXDLoIqMgqD3IO2Ah9bnf0w9kzhwN5q4FGnHZ67hBm9yePzB5JJAIQCc8x3pFnNlwFq4RidZggNAAkzWWw== +react-dom@17.0.1: + version "17.0.1" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.1.tgz#1de2560474ec9f0e334285662ede52dbc5426fc6" + integrity sha512-6eV150oJZ9U2t9svnsspTMrWNyHc6chX0KzDeAOXftRa8bNeOKTTfCJ7KorIwenkHd2xqVTBTCZd79yk/lx/Ug== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" - prop-types "^15.6.2" - scheduler "^0.19.1" + scheduler "^0.20.1" react-error-overlay@^6.0.8: version "6.0.8" @@ -10482,12 +10481,12 @@ react-ga@3.3.0: resolved "https://registry.yarnpkg.com/react-ga/-/react-ga-3.3.0.tgz#c91f407198adcb3b49e2bc5c12b3fe460039b3ca" integrity sha512-o8RScHj6Lb8cwy3GMrVH6NJvL+y0zpJvKtc0+wmH7Bt23rszJmnqEQxRbyrqUzk9DTJIHoP42bfO5rswC9SWBQ== -react-is@^16.12.0, react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.6: +react-is@^16.12.0, react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== -react-is@^17.0.1: +"react-is@^16.12.0 || ^17.0.0", react-is@^17.0.1: version "17.0.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.1.tgz#5b3531bd76a645a4c9fb6e693ed36419e3301339" integrity sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA== @@ -10603,20 +10602,28 @@ react-scripts@4.0.1: optionalDependencies: fsevents "^2.1.3" +react-shallow-renderer@^16.13.1: + version "16.14.1" + resolved "https://registry.yarnpkg.com/react-shallow-renderer/-/react-shallow-renderer-16.14.1.tgz#bf0d02df8a519a558fd9b8215442efa5c840e124" + integrity sha512-rkIMcQi01/+kxiTE9D3fdS959U1g7gs+/rborw++42m1O9FAQiNI/UNRZExVUoAOprn4umcXf+pFRou8i4zuBg== + dependencies: + object-assign "^4.1.1" + react-is "^16.12.0 || ^17.0.0" + react-table@7.6.0: version "7.6.0" resolved "https://registry.yarnpkg.com/react-table/-/react-table-7.6.0.tgz#83d765b96505b5332d108a2e0c27ab653f5a78c3" integrity sha512-16kRTypBWz9ZwLnPWA8hc3eIC64POzO9GaMBiKaCcVM+0QOQzt0G7ebzGUM8SW0CYUpVM+glv1kMXrWj9tr3Sw== -react-test-renderer@16.14.0, react-test-renderer@^16.0.0-0: - version "16.14.0" - resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.14.0.tgz#e98360087348e260c56d4fe2315e970480c228ae" - integrity sha512-L8yPjqPE5CZO6rKsKXRO/rVPiaCOy0tQQJbC+UjPNlobl5mad59lvPjwFsQHTvL03caVDIVr9x9/OSgDe6I5Eg== +react-test-renderer@17.0.1, react-test-renderer@^17.0.0-0: + version "17.0.1" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-17.0.1.tgz#3187e636c3063e6ae498aedf21ecf972721574c7" + integrity sha512-/dRae3mj6aObwkjCcxZPlxDFh73XZLgvwhhyON2haZGUEhiaY5EjfAdw+d/rQmlcFwdTpMXCSGVk374QbCTlrA== dependencies: object-assign "^4.1.1" - prop-types "^15.6.2" - react-is "^16.8.6" - scheduler "^0.19.1" + react-is "^17.0.1" + react-shallow-renderer "^16.13.1" + scheduler "^0.20.1" react-useportal@1.0.13: version "1.0.13" @@ -10625,14 +10632,13 @@ react-useportal@1.0.13: dependencies: use-ssr "^1.0.19" -react@16.14.0: - version "16.14.0" - resolved "https://registry.yarnpkg.com/react/-/react-16.14.0.tgz#94d776ddd0aaa37da3eda8fc5b6b18a4c9a3114d" - integrity sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g== +react@17.0.1: + version "17.0.1" + resolved "https://registry.yarnpkg.com/react/-/react-17.0.1.tgz#6e0600416bd57574e3f86d92edba3d9008726127" + integrity sha512-lG9c9UuMHdcAexXtigOZLX8exLWkW0Ku29qPRU8uhF2R9BN96dLCt0psvzPLlHc5OWkgymP3qwTRgbnw5BKx3w== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" - prop-types "^15.6.2" read-pkg-up@^1.0.1: version "1.0.1" @@ -11281,10 +11287,10 @@ saxes@^5.0.0: dependencies: xmlchars "^2.2.0" -scheduler@^0.19.1: - version "0.19.1" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196" - integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA== +scheduler@^0.20.1: + version "0.20.1" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.1.tgz#da0b907e24026b01181ecbc75efdc7f27b5a000c" + integrity sha512-LKTe+2xNJBNxu/QhHvDR14wUXHRQbVY5ZOYpOGWRzhydZUqrLb2JBvLPY7cAqFmqrWuDED0Mjk7013SZiOz6Bw== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1"