forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSummaryGroup.test.js
More file actions
87 lines (83 loc) · 1.85 KB
/
SummaryGroup.test.js
File metadata and controls
87 lines (83 loc) · 1.85 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import React from 'react'
import { MockedProvider } from '@apollo/client/testing'
import { render } from '@testing-library/react'
import { theme, ChakraProvider } from '@chakra-ui/react'
import { I18nProvider } from '@lingui/react'
import { setupI18n } from '@lingui/core'
import { SummaryGroup } from '../SummaryGroup'
const i18n = setupI18n({
locale: 'en',
messages: {
en: {},
},
localeData: {
en: {},
},
})
const data = {
webSummary: {
categories: [
{
name: 'pass',
count: 7468,
percentage: 56.6,
},
{
name: 'fail',
count: 5738,
percentage: 43.4,
},
],
total: 13206,
},
dmarcPhaseSummary: {
categories: [
{
name: 'not implemented',
count: 200,
percentage: 20,
},
{
name: 'assess',
count: 200,
percentage: 20,
},
{
name: 'deploy',
count: 200,
percentage: 20,
},
{
name: 'enforce',
count: 200,
percentage: 20,
},
{
name: 'maintain',
count: 200,
percentage: 20,
},
],
total: 1000,
},
}
describe('<SummaryGroup />', () => {
describe('given the data for web and email summaries', () => {
it('displays web and dmarc phase summary cards', async () => {
const { getByText } = render(
<I18nProvider i18n={i18n}>
<ChakraProvider theme={theme}>
<MockedProvider>
<SummaryGroup
web={data.webSummary}
dmarcPhases={data.dmarcPhaseSummary}
/>
</MockedProvider>
</ChakraProvider>
</I18nProvider>,
)
expect(getByText(/web encryption settings summary/i)).toBeInTheDocument()
expect(getByText(/dmarc phase summary/i)).toBeInTheDocument()
})
})
})