datahub/__tests__/pages/index.test.tsx
2020-06-04 11:48:02 +01:00

18 lines
488 B
TypeScript

import React from 'react'
import { render } from '@testing-library/react'
import renderer from 'react-test-renderer'
import Index from '../../pages/index'
test('renders snapshot homepage', () => {
const tree = renderer.create(<Index />).toJSON()
expect(tree).toMatchSnapshot()
})
test('renders text from hero section', () => {
const { getByText } = render(<Index />)
const linkElement = getByText(
/Find, Share and Publish/
)
expect(linkElement).toBeInTheDocument()
})