/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/
import { render } from '@testing-library/react';
import React from 'react';
import {
AnomalyHeatmapChart,
INITIAL_HEATMAP_DISPLAY_OPTION,
} from '../AnomalyHeatmapChart';
import {
FAKE_ANOMALY_DATA,
FAKE_DATE_RANGE,
FAKE_ENTITY_ANOMALY_SUMMARIES,
} from '../../../../pages/utils/__tests__/constants';
describe(' spec', () => {
beforeEach(() => {
jest.clearAllMocks();
});
test('AnomalyHeatmapChart with Sample anomaly data', () => {
const { container } = render(
);
expect(container).toMatchSnapshot();
});
test('AnomalyHeatmapChart with anomaly summaries data', () => {
const { container } = render(
);
expect(container).toMatchSnapshot();
});
test('AnomalyHeatmapChart with one category field', () => {
const { container, getByText } = render(
);
expect(container).toMatchSnapshot();
getByText('View by:');
getByText('test-field');
});
test('AnomalyHeatmapChart with multiple category fields', () => {
const { container, getByText } = render(
);
expect(container).toMatchSnapshot();
getByText('View by:');
getByText('test-field-1');
getByText('test-field-2');
});
});