mirror of
https://github.com/theoludwig/theoludwig.git
synced 2024-11-08 22:31:30 +01:00
test: improve coverage
This commit is contained in:
parent
c21abdcc81
commit
8027e2deed
10
__test__/pages/404.test.tsx
Normal file
10
__test__/pages/404.test.tsx
Normal file
@ -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(<Error404 />)
|
||||||
|
expect(getByText('404')).toBeInTheDocument()
|
||||||
|
})
|
||||||
|
})
|
10
__test__/pages/500.test.tsx
Normal file
10
__test__/pages/500.test.tsx
Normal file
@ -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(<Error500 />)
|
||||||
|
expect(getByText('500')).toBeInTheDocument()
|
||||||
|
})
|
||||||
|
})
|
10
components/Header/__test__/Header.test.tsx
Normal file
10
components/Header/__test__/Header.test.tsx
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { render } from '@testing-library/react'
|
||||||
|
|
||||||
|
import { Header } from '..'
|
||||||
|
|
||||||
|
describe('<Header />', () => {
|
||||||
|
it('should render', async () => {
|
||||||
|
const { getByText } = render(<Header />)
|
||||||
|
expect(getByText('Divlo')).toBeInTheDocument()
|
||||||
|
})
|
||||||
|
})
|
15
components/__test__/ErrorPage.test.tsx
Normal file
15
components/__test__/ErrorPage.test.tsx
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { render } from '@testing-library/react'
|
||||||
|
|
||||||
|
import { ErrorPage } from '../ErrorPage'
|
||||||
|
|
||||||
|
describe('<ErrorPage />', () => {
|
||||||
|
it('should render the message and statusCode', async () => {
|
||||||
|
const messageContent = 'message content'
|
||||||
|
const statusCode = 404
|
||||||
|
const { getByText } = render(
|
||||||
|
<ErrorPage statusCode={statusCode} message={messageContent} />
|
||||||
|
)
|
||||||
|
expect(getByText(messageContent)).toBeInTheDocument()
|
||||||
|
expect(getByText(statusCode)).toBeInTheDocument()
|
||||||
|
})
|
||||||
|
})
|
10
components/__test__/Footer.test.tsx
Normal file
10
components/__test__/Footer.test.tsx
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { render } from '@testing-library/react'
|
||||||
|
|
||||||
|
import { Footer } from '../Footer'
|
||||||
|
|
||||||
|
describe('<Footer />', () => {
|
||||||
|
it('should render', async () => {
|
||||||
|
const { getByText } = render(<Footer />)
|
||||||
|
expect(getByText('Divlo')).toBeInTheDocument()
|
||||||
|
})
|
||||||
|
})
|
11
components/design/__test__/Input.test.tsx
Normal file
11
components/design/__test__/Input.test.tsx
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { render } from '@testing-library/react'
|
||||||
|
|
||||||
|
import { Input } from '../Input'
|
||||||
|
|
||||||
|
describe('<Input />', () => {
|
||||||
|
it('should render the label', async () => {
|
||||||
|
const labelContent = 'label content'
|
||||||
|
const { getByText } = render(<Input label={labelContent} />)
|
||||||
|
expect(getByText(labelContent)).toBeInTheDocument()
|
||||||
|
})
|
||||||
|
})
|
@ -18,7 +18,8 @@ module.exports = {
|
|||||||
'!**/next.config.js',
|
'!**/next.config.js',
|
||||||
'!**/postcss.config.js',
|
'!**/postcss.config.js',
|
||||||
'!**/workbox-*.js',
|
'!**/workbox-*.js',
|
||||||
'!**/sw.js'
|
'!**/sw.js',
|
||||||
|
'!**/jest.config.js'
|
||||||
],
|
],
|
||||||
coverageDirectory: './coverage',
|
coverageDirectory: './coverage',
|
||||||
coverageReporters: ['text', 'cobertura']
|
coverageReporters: ['text', 'cobertura']
|
||||||
|
Loading…
Reference in New Issue
Block a user