forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDomain.test.js
More file actions
25 lines (23 loc) · 812 Bytes
/
Domain.test.js
File metadata and controls
25 lines (23 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import React from 'react'
import { waitFor, render } from '@testing-library/react'
import { MemoryRouter } from 'react-router-dom'
import { ThemeProvider, theme } from '@chakra-ui/core'
import { I18nProvider } from '@lingui/react'
import { setupI18n } from '@lingui/core'
import { Domain } from '../Domain'
describe('<Domain />', () => {
it('represents a domain', async () => {
const { getByText } = render(
<ThemeProvider theme={theme}>
<I18nProvider i18n={setupI18n()}>
<MemoryRouter initialEntries={['/']} initialIndex={0}>
<Domain lastRan={null} url="canada.ca" data-testid="domain" />
</MemoryRouter>
</I18nProvider>
</ThemeProvider>,
)
await waitFor(() => {
expect(getByText('canada.ca')).toBeInTheDocument()
})
})
})