Skip to content

Commit

Permalink
Fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
srmukher committed Dec 20, 2024
1 parent d4641c5 commit 568ca4e
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 595 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,17 +259,18 @@ export class DonutChartBase extends React.Component<IDonutChartProps, IDonutChar
focusZonePropsInHoverCard={this.props.focusZonePropsForLegendsInHoverCard}
overflowText={this.props.legendsOverflowText}
{...this.props.legendProps}
onChange={this._onLegendSelectionChange}
// eslint-disable-next-line react/jsx-no-bind
onChange={this._onLegendSelectionChange.bind(this)}
/>
);
return legends;
}

private _onLegendSelectionChange = (
private _onLegendSelectionChange(
selectedLegends: string[],
event: React.MouseEvent<HTMLButtonElement>,
currentLegend?: ILegend,
) => {
): void {
if (this.props.legendProps?.canSelectMultipleLegends) {
this.setState({ selectedLegends });
} else {
Expand All @@ -278,7 +279,7 @@ export class DonutChartBase extends React.Component<IDonutChartProps, IDonutChar
if (this.props.legendProps?.onChange) {
this.props.legendProps.onChange(selectedLegends, event, currentLegend);
}
};
}

private _isLegendHighlighted = (legend: string): boolean => {
return this._getHighlightedLegend().indexOf(legend) > -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,23 @@ exports[`DonutChart - mouse events Should render callout correctly on mouseover
role="img"
/>
</g>
<text
className=
{
fill: #323130;
font-size: 24px;
font-weight: 600;
}
@media screen and (-ms-high-contrast: white-on-black), screen and (forced-colors: active) and (prefers-color-scheme: dark){& {
fill: rgb(179, 179, 179);
}
dominantBaseline="middle"
textAnchor="middle"
y={5}
>
20,000
</text>
</g>
</svg>
</div>
Expand Down Expand Up @@ -814,6 +831,23 @@ exports[`DonutChart - mouse events Should render customized callout on mouseover
role="img"
/>
</g>
<text
className=
{
fill: #323130;
font-size: 24px;
font-weight: 600;
}
@media screen and (-ms-high-contrast: white-on-black), screen and (forced-colors: active) and (prefers-color-scheme: dark){& {
fill: rgb(179, 179, 179);
}
dominantBaseline="middle"
textAnchor="middle"
y={5}
>
20,000
</text>
</g>
</svg>
</div>
Expand Down Expand Up @@ -1877,22 +1911,6 @@ exports[`DonutChart snapShot testing Should render arc labels 1`] = `
onMouseOver={[Function]}
role="img"
/>
<text
aria-hidden={true}
className=
{
fill: #323130;
font-size: 12px;
font-weight: 600;
}
dominantBaseline="auto"
textAnchor="start"
x={35.43557344375781}
y={-50.87553571916512}
>
20.0k
</text>
</g>
<g>
<path
Expand All @@ -1919,22 +1937,6 @@ exports[`DonutChart snapShot testing Should render arc labels 1`] = `
onMouseOver={[Function]}
role="img"
/>
<text
aria-hidden={true}
className=
{
fill: #323130;
font-size: 12px;
font-weight: 600;
}
dominantBaseline="hanging"
textAnchor="start"
x={42.16983494620299}
y={45.45002772947447}
>
39.0k
</text>
</g>
<g>
<path
Expand All @@ -1961,22 +1963,6 @@ exports[`DonutChart snapShot testing Should render arc labels 1`] = `
onMouseOver={[Function]}
role="img"
/>
<text
aria-hidden={true}
className=
{
fill: #323130;
font-size: 12px;
font-weight: 600;
}
dominantBaseline="auto"
textAnchor="end"
x={-60.58001193073337}
y={-13.19326170710649}
>
45.0k
</text>
</g>
</g>
</svg>
Expand Down Expand Up @@ -2443,22 +2429,6 @@ exports[`DonutChart snapShot testing Should render arc labels in percentage form
onMouseOver={[Function]}
role="img"
/>
<text
aria-hidden={true}
className=
{
fill: #323130;
font-size: 12px;
font-weight: 600;
}
dominantBaseline="auto"
textAnchor="start"
x={35.43557344375781}
y={-50.87553571916512}
>
19%
</text>
</g>
<g>
<path
Expand All @@ -2485,22 +2455,6 @@ exports[`DonutChart snapShot testing Should render arc labels in percentage form
onMouseOver={[Function]}
role="img"
/>
<text
aria-hidden={true}
className=
{
fill: #323130;
font-size: 12px;
font-weight: 600;
}
dominantBaseline="hanging"
textAnchor="start"
x={42.16983494620299}
y={45.45002772947447}
>
38%
</text>
</g>
<g>
<path
Expand All @@ -2527,22 +2481,6 @@ exports[`DonutChart snapShot testing Should render arc labels in percentage form
onMouseOver={[Function]}
role="img"
/>
<text
aria-hidden={true}
className=
{
fill: #323130;
font-size: 12px;
font-weight: 600;
}
dominantBaseline="auto"
textAnchor="end"
x={-60.58001193073337}
y={-13.19326170710649}
>
43%
</text>
</g>
</g>
</svg>
Expand Down
Loading

0 comments on commit 568ca4e

Please sign in to comment.