import React from 'react'; import { act } from '@testing-library/react'; import { ScaleLinear } from 'eazychart-core/src'; import { Position } from 'eazychart-core/src/types'; import { colors, dimensions, rawData, scaleDefinitions, verticalLinearScaleDef, horizontalLinearScaleDef, } from 'eazychart-core/src/sample-data'; import { Axis } from '@/components/scales/Axis'; import { Chart } from '@/components/Chart'; import { baseChartProps, renderSVG } from 'tests/common'; import 'tests/mocks/ResizeObserver'; import { CartesianScale } from '@/components/scales/CartesianScale'; describe('Axis', () => { it('renders axis with four ticks', async () => { const axisChart = ( ({ ...d, isActive: true })), colors, scaleDefinitions, dimensions: { width: dimensions.width, height: dimensions.height, }, scopedSlots: { LegendComponent: () => <>{null}, Tooltip: () => <>{null}, }, }} > ); const wrapper = renderSVG(axisChart); await act(async () => { wrapper.rerender(axisChart); }); expect(wrapper.container.innerHTML).toMatchSnapshot(); }); });