/*
* 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 React from 'react';
import { render } from '@testing-library/react';
import { HistoricalRangeModal } from '../HistoricalRangeModal/HistoricalRangeModal';
describe(' spec', () => {
test('renders component when creating first historical analysis', () => {
const { getByText } = render(
);
getByText('Set up historical analysis');
});
test('renders component when editing historical analysis', () => {
const { getByText } = render(
);
getByText('Modify historical analysis');
});
test('defaults to 30 days when no existing date range', () => {
const { getByText } = render(
);
getByText('last 30 days');
});
test('defaults to detector date range if it exists', () => {
const { queryByText } = render(
);
expect(queryByText('last 30 days')).toBeNull();
});
});