Skip to content

Commit

Permalink
add test case for callout variant
Browse files Browse the repository at this point in the history
  • Loading branch information
krkshitij committed Jul 28, 2023
1 parent 1434e27 commit fb55d1e
Show file tree
Hide file tree
Showing 2 changed files with 942 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
IVerticalStackedBarChartProps,
VerticalStackedBarChart,
IVerticalStackedChartProps,
ChartHoverCardVariant,
} from '../../index';
import { IVerticalStackedBarChartState, VerticalStackedBarChartBase } from './VerticalStackedBarChart.base';
import toJson from 'enzyme-to-json';
Expand Down Expand Up @@ -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(
<VerticalStackedBarChart
data={chartPoints2}
calloutProps={{ doNotLayer: true }}
calloutVariant={ChartHoverCardVariant.LongLegend}
enabledLegendsWrapLines
/>,
);

// 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', () => {
Expand Down
Loading

0 comments on commit fb55d1e

Please sign in to comment.