From 26e7853a058942a0d32982e3b446abeff677c4d6 Mon Sep 17 00:00:00 2001 From: Kumar Kshitij Date: Fri, 28 Jul 2023 14:35:43 +0530 Subject: [PATCH] add test case for callout variant --- .../VerticalStackedBarChart.test.tsx | 20 + .../VerticalStackedBarChart.test.tsx.snap | 922 ++++++++++++++++++ 2 files changed, 942 insertions(+) diff --git a/packages/react-charting/src/components/VerticalStackedBarChart/VerticalStackedBarChart.test.tsx b/packages/react-charting/src/components/VerticalStackedBarChart/VerticalStackedBarChart.test.tsx index a91183d816c100..b434b6d6006324 100644 --- a/packages/react-charting/src/components/VerticalStackedBarChart/VerticalStackedBarChart.test.tsx +++ b/packages/react-charting/src/components/VerticalStackedBarChart/VerticalStackedBarChart.test.tsx @@ -9,6 +9,7 @@ import { IVerticalStackedBarChartProps, VerticalStackedBarChart, IVerticalStackedChartProps, + ChartHoverCardVariant, } from '../../index'; import { IVerticalStackedBarChartState, VerticalStackedBarChartBase } from './VerticalStackedBarChart.base'; import toJson from 'enzyme-to-json'; @@ -320,6 +321,25 @@ describe('VerticalStackedBarChart - mouse events', () => { const tree = toJson(wrapper, { mode: 'deep' }); expect(tree).toMatchSnapshot(); }); + + it('Should render long legend variant of callout correctly on mouseover', async () => { + wrapper = mount( + , + ); + + // Wait for the chart to be resized + await new Promise(resolve => setTimeout(resolve)); + wrapper.update(); + + wrapper.find('rect').at(0).simulate('mouseover'); + const tree = toJson(wrapper, { mode: 'deep' }); + expect(tree).toMatchSnapshot(); + }); }); describe('Render empty chart aria label div when chart is empty', () => { diff --git a/packages/react-charting/src/components/VerticalStackedBarChart/__snapshots__/VerticalStackedBarChart.test.tsx.snap b/packages/react-charting/src/components/VerticalStackedBarChart/__snapshots__/VerticalStackedBarChart.test.tsx.snap index 50cb1c41625a3b..696877b282fd8e 100644 --- a/packages/react-charting/src/components/VerticalStackedBarChart/__snapshots__/VerticalStackedBarChart.test.tsx.snap +++ b/packages/react-charting/src/components/VerticalStackedBarChart/__snapshots__/VerticalStackedBarChart.test.tsx.snap @@ -1914,6 +1914,928 @@ exports[`VerticalStackedBarChart - mouse events Should render customized callout `; +exports[`VerticalStackedBarChart - mouse events Should render long legend variant of callout correctly on mouseover 1`] = ` +