forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChartBoxPlot.test.tsx
More file actions
26 lines (24 loc) · 802 Bytes
/
ChartBoxPlot.test.tsx
File metadata and controls
26 lines (24 loc) · 802 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
import { render } from '@testing-library/react';
import { Chart } from '../Chart/Chart';
import { ChartBoxPlot } from './ChartBoxPlot';
Object.values([true, false]).forEach(() => {
test('ChartBar', () => {
const { asFragment } = render(<ChartBoxPlot />);
expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
const { asFragment } = render(
<Chart domainPadding={{ x: [30, 25] }} height={200} width={300}>
<ChartBoxPlot
data={[
{ name: 'Cats', x: '2015', y: [1, 2, 3, 5] },
{ name: 'Cats', x: '2016', y: [3, 2, 8, 10] },
{ name: 'Cats', x: '2017', y: [2, 8, 6, 5] },
{ name: 'Cats', x: '2018', y: [1, 3, 2, 9] }
]}
/>
</Chart>
);
expect(asFragment()).toMatchSnapshot();
});