crane-cloud/frontend

View on GitHub
src/components/DonutChart/DonutChart.test.js

Summary

Maintainability
A
0 mins
Test Coverage
import React from 'react';
import { shallow } from 'enzyme';
import DonutChart from '.';

describe('Test the donut chart component', () => {
    it('checks if the donut chart component matches the snapshot', () => {
        const onMouseEnter = jest.fn();
        const data = [
            { name: "sample1"},
            { name: "sample2"},
            { name: "sample3"},
            { name: "sample4"},
            { name: "sample5"},
        ];
        const DonutChartComponent = shallow(
            <DonutChart 
                center_x={0}
                center_y={0}
                InnerRadius={0}
                OuterRadius={0}
                data={data}
                height={0}
                width={0}
                onPieEnter={onMouseEnter}
            />
        );
        expect(DonutChartComponent).toMatchSnapshot();
    });
});