From 6cb34b05f2a93d988ee3f512c410e36606c13afa Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 30 May 2019 22:55:12 +0200 Subject: [PATCH] switch to @testing-library/react --- jest/setup-test-env.js | 2 +- package.json | 2 +- src/components/atoms/Button.test.jsx | 2 +- src/components/atoms/HostnameCheck.test.jsx | 2 +- src/components/atoms/LinkIcon.test.jsx | 2 +- src/components/atoms/Vcard.test.jsx | 2 +- src/components/molecules/Availability.test.jsx | 2 +- src/components/molecules/LogoUnit.test.jsx | 2 +- src/components/molecules/Networks.test.jsx | 2 +- src/components/molecules/ProjectImage.test.jsx | 2 +- src/components/molecules/ProjectLinks.test.jsx | 2 +- src/components/molecules/ProjectTechstack.test.jsx | 2 +- src/components/molecules/Repository.test.jsx | 2 +- src/components/molecules/ThemeSwitch.test.jsx | 2 +- src/components/organisms/Footer.test.jsx | 2 +- src/components/organisms/Header.test.jsx | 2 +- src/components/organisms/Repositories.test.jsx | 2 +- src/hooks/use-meta.test.js | 2 +- src/pages/__tests__/index.test.jsx | 2 +- src/store/AppProvider.test.jsx | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/jest/setup-test-env.js b/jest/setup-test-env.js index 395c3d5..f864242 100644 --- a/jest/setup-test-env.js +++ b/jest/setup-test-env.js @@ -1,6 +1,6 @@ import 'jest-dom/extend-expect' // this is basically: afterEach(cleanup) -import 'react-testing-library/cleanup-after-each' +import '@testing-library/react/cleanup-after-each' import 'jest-canvas-mock' diff --git a/package.json b/package.json index 0325db6..934974b 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "@babel/node": "^7.4.5", "@babel/preset-env": "^7.4.5", "@svgr/webpack": "^4.3.0", + "@testing-library/react": "^8.0.1", "babel-eslint": "^10.0.1", "babel-jest": "^24.7.1", "babel-preset-gatsby": "^0.1.11", @@ -80,7 +81,6 @@ "prepend": "^1.0.2", "prettier": "^1.17.0", "prettier-stylelint": "^0.4.2", - "react-testing-library": "^7.0.1", "slugify": "^1.3.4", "stylelint": "^10.0.1", "stylelint-config-css-modules": "^1.3.0", diff --git a/src/components/atoms/Button.test.jsx b/src/components/atoms/Button.test.jsx index 483dc12..749b506 100644 --- a/src/components/atoms/Button.test.jsx +++ b/src/components/atoms/Button.test.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { render } from 'react-testing-library' +import { render } from '@testing-library/react' import Button from './Button' diff --git a/src/components/atoms/HostnameCheck.test.jsx b/src/components/atoms/HostnameCheck.test.jsx index 4764907..79c034c 100644 --- a/src/components/atoms/HostnameCheck.test.jsx +++ b/src/components/atoms/HostnameCheck.test.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { render } from 'react-testing-library' +import { render } from '@testing-library/react' import HostnameCheck from './HostnameCheck' describe('HostnameCheck', () => { diff --git a/src/components/atoms/LinkIcon.test.jsx b/src/components/atoms/LinkIcon.test.jsx index 1971160..a31236c 100644 --- a/src/components/atoms/LinkIcon.test.jsx +++ b/src/components/atoms/LinkIcon.test.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { render } from 'react-testing-library' +import { render } from '@testing-library/react' import LinkIcon from './LinkIcon' diff --git a/src/components/atoms/Vcard.test.jsx b/src/components/atoms/Vcard.test.jsx index aac10df..d6bdc4e 100644 --- a/src/components/atoms/Vcard.test.jsx +++ b/src/components/atoms/Vcard.test.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { render, fireEvent, waitForElement } from 'react-testing-library' +import { render, fireEvent, waitForElement } from '@testing-library/react' import { StaticQuery } from 'gatsby' import Vcard, { constructVcard, toDataURL, init } from './Vcard' import data from '../../../jest/__fixtures__/meta.json' diff --git a/src/components/molecules/Availability.test.jsx b/src/components/molecules/Availability.test.jsx index ace6a2b..8817fdf 100644 --- a/src/components/molecules/Availability.test.jsx +++ b/src/components/molecules/Availability.test.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { render } from 'react-testing-library' +import { render } from '@testing-library/react' import Availability from './Availability' import { useStaticQuery } from 'gatsby' import data from '../../../jest/__fixtures__/meta.json' diff --git a/src/components/molecules/LogoUnit.test.jsx b/src/components/molecules/LogoUnit.test.jsx index 81b3142..a5defdf 100644 --- a/src/components/molecules/LogoUnit.test.jsx +++ b/src/components/molecules/LogoUnit.test.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { render } from 'react-testing-library' +import { render } from '@testing-library/react' import { StaticQuery } from 'gatsby' import LogoUnit from './LogoUnit' import data from '../../../jest/__fixtures__/meta.json' diff --git a/src/components/molecules/Networks.test.jsx b/src/components/molecules/Networks.test.jsx index b65d5b5..6b8718a 100644 --- a/src/components/molecules/Networks.test.jsx +++ b/src/components/molecules/Networks.test.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { render } from 'react-testing-library' +import { render } from '@testing-library/react' import { useStaticQuery } from 'gatsby' import Networks from './Networks' import data from '../../../jest/__fixtures__/meta.json' diff --git a/src/components/molecules/ProjectImage.test.jsx b/src/components/molecules/ProjectImage.test.jsx index 77ad604..b3d434b 100644 --- a/src/components/molecules/ProjectImage.test.jsx +++ b/src/components/molecules/ProjectImage.test.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { render } from 'react-testing-library' +import { render } from '@testing-library/react' import ProjectImage from './ProjectImage' import data from '../../../jest/__fixtures__/projects.json' diff --git a/src/components/molecules/ProjectLinks.test.jsx b/src/components/molecules/ProjectLinks.test.jsx index 4287e66..3764ee3 100644 --- a/src/components/molecules/ProjectLinks.test.jsx +++ b/src/components/molecules/ProjectLinks.test.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { render } from 'react-testing-library' +import { render } from '@testing-library/react' import ProjectLinks from './ProjectLinks' describe('ProjectLinks', () => { diff --git a/src/components/molecules/ProjectTechstack.test.jsx b/src/components/molecules/ProjectTechstack.test.jsx index 66d9644..148690b 100644 --- a/src/components/molecules/ProjectTechstack.test.jsx +++ b/src/components/molecules/ProjectTechstack.test.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { render } from 'react-testing-library' +import { render } from '@testing-library/react' import ProjectTechstack from './ProjectTechstack' describe('ProjectTechstack', () => { diff --git a/src/components/molecules/Repository.test.jsx b/src/components/molecules/Repository.test.jsx index ee256c2..ab60c24 100644 --- a/src/components/molecules/Repository.test.jsx +++ b/src/components/molecules/Repository.test.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { render } from 'react-testing-library' +import { render } from '@testing-library/react' import Repository from './Repository' import repos from '../../../jest/__fixtures__/repos.json' diff --git a/src/components/molecules/ThemeSwitch.test.jsx b/src/components/molecules/ThemeSwitch.test.jsx index f74bb78..d66108a 100644 --- a/src/components/molecules/ThemeSwitch.test.jsx +++ b/src/components/molecules/ThemeSwitch.test.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { render, fireEvent, cleanup } from 'react-testing-library' +import { render, fireEvent, cleanup } from '@testing-library/react' import { Provider } from '../../store/createContext' import ThemeSwitch from './ThemeSwitch' diff --git a/src/components/organisms/Footer.test.jsx b/src/components/organisms/Footer.test.jsx index 2127680..77d45e6 100644 --- a/src/components/organisms/Footer.test.jsx +++ b/src/components/organisms/Footer.test.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { render } from 'react-testing-library' +import { render } from '@testing-library/react' import { StaticQuery, useStaticQuery } from 'gatsby' import Footer from './Footer' import data from '../../../jest/__fixtures__/meta.json' diff --git a/src/components/organisms/Header.test.jsx b/src/components/organisms/Header.test.jsx index 64f6416..eb714ce 100644 --- a/src/components/organisms/Header.test.jsx +++ b/src/components/organisms/Header.test.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { render } from 'react-testing-library' +import { render } from '@testing-library/react' import { StaticQuery, useStaticQuery } from 'gatsby' import Header from './Header' import { Provider } from '../../store/createContext' diff --git a/src/components/organisms/Repositories.test.jsx b/src/components/organisms/Repositories.test.jsx index 916cd35..407afe8 100644 --- a/src/components/organisms/Repositories.test.jsx +++ b/src/components/organisms/Repositories.test.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { render } from 'react-testing-library' +import { render } from '@testing-library/react' import Repositories from './Repositories' import repos from '../../../jest/__fixtures__/repos.json' diff --git a/src/hooks/use-meta.test.js b/src/hooks/use-meta.test.js index 8f03f6f..f43d1b6 100644 --- a/src/hooks/use-meta.test.js +++ b/src/hooks/use-meta.test.js @@ -1,5 +1,5 @@ import React from 'react' -import { render } from 'react-testing-library' +import { render } from '@testing-library/react' import { useStaticQuery } from 'gatsby' import { useMeta } from './use-meta' import data from '../../jest/__fixtures__/meta.json' diff --git a/src/pages/__tests__/index.test.jsx b/src/pages/__tests__/index.test.jsx index 1230658..88222cf 100644 --- a/src/pages/__tests__/index.test.jsx +++ b/src/pages/__tests__/index.test.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { render } from 'react-testing-library' +import { render } from '@testing-library/react' import { StaticQuery } from 'gatsby' import Home from '../index' import meta from '../../../jest/__fixtures__/meta.json' diff --git a/src/store/AppProvider.test.jsx b/src/store/AppProvider.test.jsx index a5ef88f..527ba69 100644 --- a/src/store/AppProvider.test.jsx +++ b/src/store/AppProvider.test.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { render } from 'react-testing-library' +import { render } from '@testing-library/react' import AppProvider from './AppProvider.jsx' describe('AppProvider', () => {