forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFooter.test.js
More file actions
35 lines (31 loc) · 792 Bytes
/
Footer.test.js
File metadata and controls
35 lines (31 loc) · 792 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
26
27
28
29
30
31
32
33
34
35
import React from 'react'
import { I18nProvider } from '@lingui/react'
import { theme, ThemeProvider } from '@chakra-ui/core'
import { Footer } from '../Footer'
import { render } from '@testing-library/react'
import { setupI18n } from '@lingui/core'
const i18n = setupI18n({
locale: 'en',
messages: {
en: {},
},
localeData: {
en: {},
},
})
describe('<Footer />', () => {
beforeEach(() => (global.scrollTo = jest.fn()))
it('renders children correctly', () => {
const { getAllByText } = render(
<ThemeProvider theme={theme}>
<I18nProvider i18n={i18n}>
<Footer>
<div>foo</div>
</Footer>
</I18nProvider>
</ThemeProvider>,
)
const test = getAllByText(/foo/)
expect(test).toHaveLength(1)
})
})