diff --git a/__test__/pages/404.test.tsx b/__test__/pages/404.test.tsx new file mode 100644 index 0000000..72a2032 --- /dev/null +++ b/__test__/pages/404.test.tsx @@ -0,0 +1,10 @@ +import { render } from '@testing-library/react' + +import Error404 from 'pages/404' + +describe('GET /404', () => { + it('should render', async () => { + const { getByText } = render() + expect(getByText('404')).toBeInTheDocument() + }) +}) diff --git a/__test__/pages/500.test.tsx b/__test__/pages/500.test.tsx new file mode 100644 index 0000000..4d9d3b1 --- /dev/null +++ b/__test__/pages/500.test.tsx @@ -0,0 +1,10 @@ +import { render } from '@testing-library/react' + +import Error500 from 'pages/500' + +describe('GET /500', () => { + it('should render', async () => { + const { getByText } = render() + expect(getByText('500')).toBeInTheDocument() + }) +}) diff --git a/components/Footer/index.tsx b/components/Footer.tsx similarity index 100% rename from components/Footer/index.tsx rename to components/Footer.tsx diff --git a/components/Header/__test__/Header.test.tsx b/components/Header/__test__/Header.test.tsx new file mode 100644 index 0000000..d960b96 --- /dev/null +++ b/components/Header/__test__/Header.test.tsx @@ -0,0 +1,10 @@ +import { render } from '@testing-library/react' + +import { Header } from '..' + +describe('
', () => { + it('should render', async () => { + const { getByText } = render(
) + expect(getByText('Divlo')).toBeInTheDocument() + }) +}) diff --git a/components/__test__/ErrorPage.test.tsx b/components/__test__/ErrorPage.test.tsx new file mode 100644 index 0000000..b84f95c --- /dev/null +++ b/components/__test__/ErrorPage.test.tsx @@ -0,0 +1,15 @@ +import { render } from '@testing-library/react' + +import { ErrorPage } from '../ErrorPage' + +describe('', () => { + it('should render the message and statusCode', async () => { + const messageContent = 'message content' + const statusCode = 404 + const { getByText } = render( + + ) + expect(getByText(messageContent)).toBeInTheDocument() + expect(getByText(statusCode)).toBeInTheDocument() + }) +}) diff --git a/components/__test__/Footer.test.tsx b/components/__test__/Footer.test.tsx new file mode 100644 index 0000000..4991403 --- /dev/null +++ b/components/__test__/Footer.test.tsx @@ -0,0 +1,10 @@ +import { render } from '@testing-library/react' + +import { Footer } from '../Footer' + +describe('