aaronjy-me/__test__/layouts/DefaultLayout.test.jsx
2024-08-22 19:45:55 +01:00

29 lines
806 B
JavaScript

/* eslint-env jest */
import { render, screen } from '@testing-library/react'
import DefaultLayout from '../../src/layouts/DefaultLayout/DefaultLayout'
import '@testing-library/jest-dom'
describe('DefaultLayout', () => {
const props = {
children: <div>Test Content</div>
}
it('renders without crashing', () => {
render(<DefaultLayout {...props} />)
})
it('renders Header', () => {
render(<DefaultLayout {...props} />)
expect(screen.getByTestId('header')).toBeInTheDocument()
})
it('renders Footer', () => {
render(<DefaultLayout {...props} />)
expect(screen.getByTestId('footer')).toBeInTheDocument()
})
it('renders children correctly', () => {
render(<DefaultLayout {...props} />)
expect(screen.getByText('Test Content')).toBeInTheDocument()
})
})