forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChartCursorContainer.test.tsx
More file actions
37 lines (35 loc) · 1.14 KB
/
ChartCursorContainer.test.tsx
File metadata and controls
37 lines (35 loc) · 1.14 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
import * as React from 'react';
import { render } from '@testing-library/react';
import { ChartArea } from '../ChartArea/ChartArea';
import { ChartGroup } from '../ChartGroup/ChartGroup';
import { ChartCursorContainer } from './ChartCursorContainer';
Object.values([true, false]).forEach(() => {
test('ChartVoronoiContainer', () => {
const { asFragment } = render(<ChartCursorContainer />);
expect(asFragment()).toMatchSnapshot();
});
});
test('renders container via ChartGroup', () => {
const { asFragment } = render(
<ChartGroup containerComponent={<ChartCursorContainer />} height={200} width={200}>
<ChartArea
data={[
{ name: 'Cats', x: 1, y: 1 },
{ name: 'Cats', x: 2, y: 2 },
{ name: 'Cats', x: 3, y: 3.2 },
{ name: 'Cats', x: 4, y: 3.5 }
]}
/>
<ChartArea
data={[
{ name: 'Dogs', x: 1, y: 0.5 },
{ name: 'Dogs', x: 2, y: 1 },
{ name: 'Dogs', x: 3, y: 2 },
{ name: 'Dogs', x: 4, y: 2.5 },
{ name: 'Dogs', x: 5, y: 2.5 }
]}
/>
</ChartGroup>
);
expect(asFragment()).toMatchSnapshot();
});