forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrganizationCard.test.js
More file actions
34 lines (31 loc) · 1.13 KB
/
OrganizationCard.test.js
File metadata and controls
34 lines (31 loc) · 1.13 KB
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
import React from 'react'
import { render } from '@testing-library/react'
import { MemoryRouter } from 'react-router-dom'
import { ThemeProvider, theme } from '@chakra-ui/core'
import { I18nProvider } from '@lingui/react'
import { MockedProvider } from '@apollo/client/testing'
import { setupI18n } from '@lingui/core'
import { OrganizationCard } from '../OrganizationCard'
describe('<OrganizationsCard />', () => {
it('successfully renders card with org name and number of services', async () => {
const { getByText } = render(
<MockedProvider>
<MemoryRouter initialEntries={['/']}>
<ThemeProvider theme={theme}>
<I18nProvider i18n={setupI18n()}>
<OrganizationCard
slug="tbs-sct-gc-ca"
name="Treasury Board Secretariat"
domainCount={7}
/>
</I18nProvider>
</ThemeProvider>
</MemoryRouter>
</MockedProvider>,
)
const orgName = getByText(/Treasury Board Secretariat/i)
expect(orgName).toBeDefined()
const domainCount = getByText(/Services: 7/i)
expect(domainCount).toBeDefined()
})
})