diff --git a/src/components/AppVersion/test.spec.js b/src/components/AppVersion/test.spec.js deleted file mode 100644 index 9c74060..0000000 --- a/src/components/AppVersion/test.spec.js +++ /dev/null @@ -1,29 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import { I18nextProvider } from 'react-i18next'; -import i18n from '../../../i18n'; - -import pkg from '../../../../package.json'; - -import AppVersion from '.'; - -const appVersion = pkg.version; -const reactVersion = pkg.dependencies.react.replace('^', ''); - -describe("Should render ", () => { - beforeEach(() => { - render( - - - - ); - }) - it('renders AppVersion', () => { - expect(screen.getByTestId('app-version')).toBeInTheDocument(); - }); - it('AppVersion validation version SlideContent', () => { - expect(screen.getByTestId('app-version').textContent).toBe(`SlideContent ${appVersion}`); - }); - it('AppVersion validation version React', () => { - expect(screen.getByTestId('react-version').textContent).toBe(`React ${reactVersion}`); - }); -}); diff --git a/src/components/AppVersion/test.spec.tsx b/src/components/AppVersion/test.spec.tsx new file mode 100644 index 0000000..2ea0651 --- /dev/null +++ b/src/components/AppVersion/test.spec.tsx @@ -0,0 +1,27 @@ +import { render, screen } from "@testing-library/react"; + +import pkg from "../../../package.json"; + +import AppVersion from "."; + +const appVersion = pkg.version; +const reactVersion = pkg.dependencies.react.replace("^", ""); + +describe("Should render ", () => { + beforeEach(() => { + render(); + }); + it("renders AppVersion", () => { + expect(screen.getByTestId("app-version")).toBeInTheDocument(); + }); + it("AppVersion validation version react-techs-logos", () => { + expect(screen.getByTestId("app-version").textContent).toBe( + `react-techs-logos ${appVersion}` + ); + }); + it("AppVersion validation version React", () => { + expect(screen.getByTestId("react-version").textContent).toBe( + `React ${reactVersion}` + ); + }); +}); diff --git a/src/components/Footer/test.spec.js b/src/components/Footer/test.spec.js deleted file mode 100644 index fc28f44..0000000 --- a/src/components/Footer/test.spec.js +++ /dev/null @@ -1,25 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import { I18nextProvider } from 'react-i18next'; -import i18n from '../../../i18n'; - -import AppFooter from '.'; - -import pkg from '../../../../package.json'; - -const appVersion = pkg.version; -const reactVersion = pkg.dependencies.react.replace('^', ''); - -describe("Should render ", () => { - it('renders footer with credits and link', () => { - render( - - - - ); - - const title = screen.getByTestId('app-footer'); - - expect(title.querySelector('a').href).toBe('https://github.com/criar-art/slidecontent-react') - expect(title.querySelector('a').textContent).toBe(`React ${reactVersion}SlideContent ${appVersion}@lucasferreiralimax`) - }); -}); diff --git a/src/components/Footer/test.spec.tsx b/src/components/Footer/test.spec.tsx new file mode 100644 index 0000000..156e2f5 --- /dev/null +++ b/src/components/Footer/test.spec.tsx @@ -0,0 +1,23 @@ +import { render, screen } from "@testing-library/react"; + +import AppFooter from "."; + +import pkg from "../../../package.json"; + +const appVersion = pkg.version; +const reactVersion = pkg.dependencies.react.replace("^", ""); + +describe("Should render ", () => { + it("renders footer with credits and link", () => { + render(); + + const title: any = screen.getByTestId("app-footer"); + + expect(title.querySelector("a").href).toBe( + "https://github.com/criar-art/react-techs-logos" + ); + expect(title.querySelector("a").textContent).toBe( + `React ${reactVersion}react-techs-logos ${appVersion}@lucasferreiralimax` + ); + }); +});