From 5f1fb123ea1a8917aff96523e78cbe65bafa0dc8 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 7 Mar 2023 17:50:02 +0000 Subject: [PATCH] Update to React 18 --- package.json | 7 +++---- test/hooks/useDebouncedCallback-test.tsx | 2 +- test/hooks/useLatestResult-test.tsx | 4 ++-- test/hooks/useProfileInfo-test.tsx | 3 +-- test/hooks/usePublicRoomDirectory-test.tsx | 3 +-- test/hooks/useSlidingSyncRoomSearch-test.tsx | 3 +-- test/hooks/useUserDirectory-test.tsx | 3 +-- test/hooks/useUserOnboardingTasks-test.tsx | 2 +- 8 files changed, 11 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 0a705f4cbac..3f9234ad407 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,6 @@ "@matrix-org/matrix-wysiwyg": "2.17.0", "@matrix-org/react-sdk-module-api": "^2.4.0", "@sentry/browser": "^7.0.0", - "@testing-library/react-hooks": "^8.0.1", "await-lock": "^2.1.0", "blurhash": "^2.0.3", "classnames": "^2.2.6", @@ -107,10 +106,10 @@ "posthog-js": "1.126.0", "qrcode": "1.5.3", "re-resizable": "^6.9.0", - "react": "17.0.2", + "react": "^18.2.0", "react-beautiful-dnd": "^13.1.0", "react-blurhash": "^0.3.0", - "react-dom": "17.0.2", + "react-dom": "^18.2.0", "react-focus-lock": "^2.5.1", "react-transition-group": "^4.4.1", "rfc4648": "^1.4.0", @@ -152,7 +151,7 @@ "@casualbot/jest-sonar-reporter": "2.2.7", "@peculiar/webcrypto": "^1.4.3", "@testing-library/jest-dom": "^6.0.0", - "@testing-library/react": "^12.1.5", + "@testing-library/react": "^14", "@testing-library/user-event": "^14.4.3", "@types/commonmark": "^0.27.4", "@types/counterpart": "^0.18.1", diff --git a/test/hooks/useDebouncedCallback-test.tsx b/test/hooks/useDebouncedCallback-test.tsx index 2d3b32e7f5f..d8187a564f4 100644 --- a/test/hooks/useDebouncedCallback-test.tsx +++ b/test/hooks/useDebouncedCallback-test.tsx @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { renderHook } from "@testing-library/react-hooks"; +import { renderHook } from "@testing-library/react"; import { useDebouncedCallback } from "../../src/hooks/spotlight/useDebouncedCallback"; diff --git a/test/hooks/useLatestResult-test.tsx b/test/hooks/useLatestResult-test.tsx index a561a82c097..053a5f3126e 100644 --- a/test/hooks/useLatestResult-test.tsx +++ b/test/hooks/useLatestResult-test.tsx @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { renderHook, RenderHookResult } from "@testing-library/react-hooks/dom"; +import { renderHook, RenderHookResult } from "@testing-library/react"; import { useLatestResult } from "../../src/hooks/useLatestResult"; @@ -28,7 +28,7 @@ beforeEach(() => { }); function simulateRequest( - hookResult: RenderHookResult>["result"], + hookResult: RenderHookResult, typeof useLatestResult>["result"], { id, delayInMs, result }: { id: string; delayInMs: number; result: string }, ) { const [setQuery, setResult] = hookResult.current; diff --git a/test/hooks/useProfileInfo-test.tsx b/test/hooks/useProfileInfo-test.tsx index 63b78f78b17..3a895355e6d 100644 --- a/test/hooks/useProfileInfo-test.tsx +++ b/test/hooks/useProfileInfo-test.tsx @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { waitFor } from "@testing-library/react"; -import { renderHook, act } from "@testing-library/react-hooks/dom"; +import { waitFor, renderHook, act } from "@testing-library/react"; import { MatrixClient } from "matrix-js-sdk/src/matrix"; import { useProfileInfo } from "../../src/hooks/useProfileInfo"; diff --git a/test/hooks/usePublicRoomDirectory-test.tsx b/test/hooks/usePublicRoomDirectory-test.tsx index c313e54d9b9..5fec9312533 100644 --- a/test/hooks/usePublicRoomDirectory-test.tsx +++ b/test/hooks/usePublicRoomDirectory-test.tsx @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { waitFor } from "@testing-library/react"; -import { renderHook, act } from "@testing-library/react-hooks/dom"; +import { waitFor, renderHook, act } from "@testing-library/react"; import { IRoomDirectoryOptions, MatrixClient } from "matrix-js-sdk/src/matrix"; import { usePublicRoomDirectory } from "../../src/hooks/usePublicRoomDirectory"; diff --git a/test/hooks/useSlidingSyncRoomSearch-test.tsx b/test/hooks/useSlidingSyncRoomSearch-test.tsx index 0b21b585759..108afee3db9 100644 --- a/test/hooks/useSlidingSyncRoomSearch-test.tsx +++ b/test/hooks/useSlidingSyncRoomSearch-test.tsx @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { waitFor } from "@testing-library/react"; -import { renderHook, act } from "@testing-library/react-hooks/dom"; +import { waitFor, renderHook, act } from "@testing-library/react"; import { mocked } from "jest-mock"; import { SlidingSync } from "matrix-js-sdk/src/sliding-sync"; import { Room } from "matrix-js-sdk/src/matrix"; diff --git a/test/hooks/useUserDirectory-test.tsx b/test/hooks/useUserDirectory-test.tsx index 8d2906f349b..29e4ec7bebd 100644 --- a/test/hooks/useUserDirectory-test.tsx +++ b/test/hooks/useUserDirectory-test.tsx @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { waitFor } from "@testing-library/react"; -import { renderHook, act } from "@testing-library/react-hooks/dom"; +import { waitFor, renderHook, act } from "@testing-library/react"; import { MatrixClient } from "matrix-js-sdk/src/matrix"; import { useUserDirectory } from "../../src/hooks/useUserDirectory"; diff --git a/test/hooks/useUserOnboardingTasks-test.tsx b/test/hooks/useUserOnboardingTasks-test.tsx index f2d65382a4d..398ed431b59 100644 --- a/test/hooks/useUserOnboardingTasks-test.tsx +++ b/test/hooks/useUserOnboardingTasks-test.tsx @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { renderHook } from "@testing-library/react-hooks"; +import { renderHook } from "@testing-library/react"; import { useUserOnboardingTasks } from "../../src/hooks/useUserOnboardingTasks";