From d9f8bc5e7262839c1b0b37d98a57b16f4b47cd7d Mon Sep 17 00:00:00 2001 From: "Matheus P. Silva" Date: Mon, 3 Feb 2025 17:21:26 -0300 Subject: [PATCH] chore: remove react 17 warnings on test (#2667) ## What's the purpose of this pull request? - Remove React 17 warnings on test --- packages/sdk/package.json | 2 +- .../sdk/test/analytics/useAnalyticsEvent.test.ts | 2 +- packages/sdk/test/search/Provider.test.tsx | 2 +- packages/sdk/test/search/usePagination.test.tsx | 2 +- packages/sdk/test/ui/Provider.test.tsx | 2 +- yarn.lock | 15 --------------- 6 files changed, 5 insertions(+), 20 deletions(-) diff --git a/packages/sdk/package.json b/packages/sdk/package.json index c4f96040e3..2e6b3c4acf 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -37,7 +37,7 @@ }, "devDependencies": { "@size-limit/preset-small-lib": "^7.0.8", - "@testing-library/react-hooks": "^8.0.1", + "@testing-library/react": "^14.3.0", "fake-indexeddb": "^3.1.3", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", diff --git a/packages/sdk/test/analytics/useAnalyticsEvent.test.ts b/packages/sdk/test/analytics/useAnalyticsEvent.test.ts index 4867bee35d..5c213bd78e 100644 --- a/packages/sdk/test/analytics/useAnalyticsEvent.test.ts +++ b/packages/sdk/test/analytics/useAnalyticsEvent.test.ts @@ -1,4 +1,4 @@ -import { renderHook } from '@testing-library/react-hooks' +import { renderHook } from '@testing-library/react' import { useAnalyticsEvent } from '../../src/analytics/useAnalyticsEvent' import { wrap } from '../../src/analytics/wrap' diff --git a/packages/sdk/test/search/Provider.test.tsx b/packages/sdk/test/search/Provider.test.tsx index 9d120ae04d..f6ae2839fd 100644 --- a/packages/sdk/test/search/Provider.test.tsx +++ b/packages/sdk/test/search/Provider.test.tsx @@ -1,4 +1,4 @@ -import { act, renderHook } from '@testing-library/react-hooks' +import { act, renderHook } from '@testing-library/react' import type { ComponentPropsWithoutRef } from 'react' import React from 'react' diff --git a/packages/sdk/test/search/usePagination.test.tsx b/packages/sdk/test/search/usePagination.test.tsx index 9ba530fdbc..c6a4f74b8e 100644 --- a/packages/sdk/test/search/usePagination.test.tsx +++ b/packages/sdk/test/search/usePagination.test.tsx @@ -1,4 +1,4 @@ -import { renderHook } from '@testing-library/react-hooks' +import { renderHook } from '@testing-library/react' import React, { type PropsWithChildren } from 'react' import { initSearchState, SearchProvider, usePagination } from '../../src' diff --git a/packages/sdk/test/ui/Provider.test.tsx b/packages/sdk/test/ui/Provider.test.tsx index 08a7804257..521176f0f7 100644 --- a/packages/sdk/test/ui/Provider.test.tsx +++ b/packages/sdk/test/ui/Provider.test.tsx @@ -1,5 +1,5 @@ import React, { type PropsWithChildren } from 'react' -import { act, renderHook } from '@testing-library/react-hooks' +import { act, renderHook } from '@testing-library/react' import type { FC } from 'react' import { UIProvider, useGlobalUIState } from '../../src' diff --git a/yarn.lock b/yarn.lock index b324e05fcc..5dac31945f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5308,14 +5308,6 @@ lodash "^4.17.21" redent "^3.0.0" -"@testing-library/react-hooks@^8.0.1": - version "8.0.1" - resolved "https://registry.npmjs.org/@testing-library/react-hooks/-/react-hooks-8.0.1.tgz" - integrity sha512-Aqhl2IVmLt8IovEVarNDFuJDVWVvhnr9/GCU6UUnrYXwgDFF9h2L2o2P9KBni1AST5sT6riAyoukFLyjQUgD/g== - dependencies: - "@babel/runtime" "^7.12.5" - react-error-boundary "^3.1.0" - "@testing-library/react@^14.3.0": version "14.3.1" resolved "https://registry.npmjs.org/@testing-library/react/-/react-14.3.1.tgz" @@ -16101,13 +16093,6 @@ react-dom@^18.2.0: loose-envify "^1.1.0" scheduler "^0.23.0" -react-error-boundary@^3.1.0: - version "3.1.4" - resolved "https://registry.npmjs.org/react-error-boundary/-/react-error-boundary-3.1.4.tgz" - integrity sha512-uM9uPzZJTF6wRQORmSrvOIgt4lJ9MC1sNgEOj2XGsDTRE4kmpWxg7ENK9EWNKJRMAOY9z0MuF4yIfl6gp4sotA== - dependencies: - "@babel/runtime" "^7.12.5" - react-intersection-observer@^8.32.5: version "8.34.0" resolved "https://registry.npmjs.org/react-intersection-observer/-/react-intersection-observer-8.34.0.tgz"