fix locally broken unit tests (#149811)

## Summary

Due to an old Pull request, 2 of the Unit Tests started to fail locally.
Somehow they won't fail on the CI which made them tough to identify
initially.

This PR fixes those broken unit tests.
This commit is contained in:
Achyut Jhunjhunwala 2023-01-30 23:09:39 +01:00 committed by GitHub
parent 61992632ec
commit 214eb97949
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,8 +77,9 @@ export function TimeseriesChartWithContext({
const annotationColor = theme.eui.euiColorSuccess;
const { annotations } = useAnnotationsContext();
const getAnnotations = () => (
const timeseriesAnnotations = [
<LineAnnotation
key="annotations"
id="annotations"
domainType={AnnotationDomainType.XDomain}
dataValues={annotations.map((annotation) => ({
@ -93,8 +94,8 @@ export function TimeseriesChartWithContext({
}}
marker={<EuiIcon type="dot" color={annotationColor} />}
markerPosition={Position.Top}
/>
);
/>,
];
return (
<TimeseriesChart
id={id}
@ -105,7 +106,7 @@ export function TimeseriesChartWithContext({
yLabelFormat={yLabelFormat}
yTickFormat={yTickFormat}
showAnnotations={showAnnotations}
annotations={[getAnnotations()]}
annotations={timeseriesAnnotations}
yDomain={yDomain}
anomalyTimeseries={anomalyTimeseries}
customTheme={customTheme}