Skip to content

Commit

Permalink
chore: Update @testing-library
Browse files Browse the repository at this point in the history
...to remove React 17 errors.
  • Loading branch information
bprusinowski committed Dec 1, 2023
1 parent 08fbffb commit 34a3c1e
Show file tree
Hide file tree
Showing 9 changed files with 236 additions and 59 deletions.
14 changes: 7 additions & 7 deletions app/charts/map/helpers.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderHook } from "@testing-library/react-hooks";
import { renderHook } from "@testing-library/react";

import { BBox } from "@/config-types";

Expand All @@ -22,8 +22,8 @@ const featuresBBox = [
describe("useViewState", () => {
it("should properly set defaultViewState", () => {
const { result, rerender } = renderHook<
ViewStateInitializationProps,
ReturnType<typeof useViewState>
ReturnType<typeof useViewState>,
ViewStateInitializationProps
>((props: ViewStateInitializationProps) => useViewState(props), {
initialProps: {
width,
Expand All @@ -49,8 +49,8 @@ describe("useViewState", () => {

it("should properly set viewState", () => {
const { result } = renderHook<
ViewStateInitializationProps,
ReturnType<typeof useViewState>
ReturnType<typeof useViewState>,
ViewStateInitializationProps
>((props: ViewStateInitializationProps) => useViewState(props), {
initialProps: {
width,
Expand All @@ -66,8 +66,8 @@ describe("useViewState", () => {
);

const { result: resultLocked } = renderHook<
ViewStateInitializationProps,
ReturnType<typeof useViewState>
ReturnType<typeof useViewState>,
ViewStateInitializationProps
>((props: ViewStateInitializationProps) => useViewState(props), {
initialProps: {
width,
Expand Down
2 changes: 1 addition & 1 deletion app/charts/shared/use-observation-labels.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderHook } from "@testing-library/react-hooks";
import { renderHook } from "@testing-library/react";

import { useObservationLabels } from "@/charts/shared/observation-labels";
import { Observation } from "@/domain/data";
Expand Down
2 changes: 1 addition & 1 deletion app/components/use-redirect-to-versioned-cube.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderHook } from "@testing-library/react-hooks";
import { renderHook } from "@testing-library/react";
import { NextRouter, useRouter } from "next/router";

import { useLocale } from "@/locales/use-locale";
Expand Down
2 changes: 1 addition & 1 deletion app/configurator/use-filter-changes.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderHook } from "@testing-library/react-hooks";
import { renderHook } from "@testing-library/react";
import merge from "lodash/merge";

import { Filters } from "@/config-types";
Expand Down
2 changes: 1 addition & 1 deletion app/domain/datasource/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { act, renderHook } from "@testing-library/react-hooks";
import { act, renderHook } from "@testing-library/react";
import mittEmitter from "next/dist/shared/lib/mitt";
import { SingletonRouter } from "next/router";

Expand Down
2 changes: 1 addition & 1 deletion app/formatters.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderHook } from "@testing-library/react-hooks";
import { renderHook } from "@testing-library/react";

import {
getTimeIntervalFormattedSelectOptions,
Expand Down
3 changes: 1 addition & 2 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@
"@playwright-testing-library/test": "^4.5.0",
"@playwright/test": "^1.32.1",
"@svgr/cli": "^5.5.0",
"@testing-library/react": "^12.1.2",
"@testing-library/react-hooks": "^7.0.2",
"@testing-library/react": "^14.1.2",
"@types/autosuggest-highlight": "^3.2.0",
"@types/clownface": "^1.0.3",
"@types/cors": "^2.8.8",
Expand Down
2 changes: 1 addition & 1 deletion app/utils/router/use-route-state.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { act, renderHook } from "@testing-library/react-hooks";
import { act, renderHook } from "@testing-library/react";
import mittEmitter from "next/dist/shared/lib/mitt";
import { useRouter } from "next/router";

Expand Down
Loading

0 comments on commit 34a3c1e

Please sign in to comment.