forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChart.test.tsx
More file actions
54 lines (52 loc) · 1.29 KB
/
Copy pathChart.test.tsx
File metadata and controls
54 lines (52 loc) · 1.29 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
import * as React from 'react';
import { render } from '@testing-library/react';
import { Chart } from './Chart';
import { ChartGroup } from '../ChartGroup/ChartGroup';
import { ChartLine } from '../ChartLine/ChartLine';
Object.values([true, false]).forEach(() => {
test('Chart', () => {
const { asFragment } = render(<Chart />);
expect(asFragment()).toMatchSnapshot();
});
});
test('renders axis and component children', () => {
const { asFragment } = render(
<Chart minDomain={{ y: 0 }} height={200} width={200}>
<ChartGroup>
<ChartLine
data={[
{ x: 1, y: 1 },
{ x: 2, y: 2 },
{ x: 3, y: 5 },
{ x: 4, y: 3 }
]}
/>
<ChartLine
data={[
{ x: 1, y: 2 },
{ x: 2, y: 1 },
{ x: 3, y: 7 },
{ x: 4, y: 4 }
]}
/>
<ChartLine
data={[
{ x: 1, y: 3 },
{ x: 2, y: 4 },
{ x: 3, y: 9 },
{ x: 4, y: 5 }
]}
/>
<ChartLine
data={[
{ x: 1, y: 3 },
{ x: 2, y: 3 },
{ x: 3, y: 8 },
{ x: 4, y: 7 }
]}
/>
</ChartGroup>
</Chart>
);
expect(asFragment()).toMatchSnapshot();
});