import React from 'react'; import { render } from '@testing-library/react'; import { dimensions, padding, animationOptions, rawData, } from 'eazychart-core/src/sample-data'; import { Chart } from '@/components/Chart'; import 'tests/mocks/ResizeObserver'; import { Tooltip } from '@/components/addons/tooltip/Tooltip'; describe('Chart', () => { it('renders svg chart container with the right slots', async () => { const wrapper = render(
Legend Slot
, TooltipComponent: () =>
Tooltip Slot
, }} >
Default Slot
); expect(wrapper.container.innerHTML).toMatchSnapshot(); }); it('should provide the chart data to the children components', async () => { const wrapper = render(
{JSON.stringify(rawData)}
); expect(wrapper.container.innerHTML).toMatchSnapshot(); }); });