1
0
Fork 0
blog/src/components/templates/Photos.test.tsx

26 lines
660 B
TypeScript
Raw Normal View History

2019-11-24 14:29:25 +01:00
import React from 'react'
import { render } from '@testing-library/react'
2020-07-19 13:31:27 +02:00
import Photos from './Photos'
2022-05-12 01:00:19 +02:00
import data from '../../../.jest/__fixtures__/photos.json'
2019-11-24 14:29:25 +01:00
describe('/photos', () => {
it('renders without crashing', () => {
2020-07-19 13:31:27 +02:00
const pageContext = {
slug: '/photos',
currentPageNumber: 2,
numPages: 20
}
const { container } = render(
// @ts-expect-error: only testing first render
2021-03-01 00:36:51 +01:00
<Photos
data={data as unknown as Queries.PhotosTemplateQuery}
2021-03-01 00:36:51 +01:00
pageContext={pageContext}
location={{ pathname: '/photos' } as any}
/>
2020-07-19 13:31:27 +02:00
)
2019-11-24 14:29:25 +01:00
expect(container.firstChild).toBeInTheDocument()
})
})