2020-05-07 08:03:30 +02:00
|
|
|
import React from 'react'
|
|
|
|
import { render } from '@testing-library/react'
|
2020-06-30 16:22:22 +02:00
|
|
|
import Home from '../../../src/components/pages/Home'
|
2020-06-30 19:38:02 +02:00
|
|
|
import {
|
|
|
|
createHistory,
|
|
|
|
createMemorySource,
|
|
|
|
LocationProvider
|
|
|
|
} from '@reach/router'
|
2020-05-07 08:03:30 +02:00
|
|
|
|
|
|
|
describe('Home', () => {
|
|
|
|
it('renders without crashing', () => {
|
2020-06-30 19:38:02 +02:00
|
|
|
const history = createHistory(createMemorySource('/search?text=water'))
|
|
|
|
|
|
|
|
const { container } = render(
|
|
|
|
<LocationProvider history={history}>
|
|
|
|
<Home />
|
|
|
|
</LocationProvider>
|
|
|
|
)
|
2020-05-07 08:03:30 +02:00
|
|
|
expect(container.firstChild).toBeInTheDocument()
|
|
|
|
})
|
|
|
|
})
|