diff --git a/models/interfaces.ts b/models/interfaces.ts index 3c393422f..a92554ca3 100644 --- a/models/interfaces.ts +++ b/models/interfaces.ts @@ -20,7 +20,7 @@ export interface Rule { export interface Detector { id?: string; - type: 'detector'; + type: string; detector_type: string; name: string; enabled: boolean; diff --git a/public/components/DeleteModal/DeleteModal.test.tsx b/public/components/DeleteModal/DeleteModal.test.tsx index 4a187ea45..67d1561dc 100644 --- a/public/components/DeleteModal/DeleteModal.test.tsx +++ b/public/components/DeleteModal/DeleteModal.test.tsx @@ -17,6 +17,7 @@ describe(' spec', () => { type={'some type'} /> ); + expect(tree).toMatchSnapshot(); }); }); diff --git a/public/components/FormFieldHeader/FormFieldHeader.test.tsx b/public/components/FormFieldHeader/FormFieldHeader.test.tsx index a696d8830..0ce747854 100644 --- a/public/components/FormFieldHeader/FormFieldHeader.test.tsx +++ b/public/components/FormFieldHeader/FormFieldHeader.test.tsx @@ -10,6 +10,7 @@ import { FormFieldHeader } from './FormFieldHeader'; describe(' spec', () => { it('renders the component', () => { const tree = render(); + expect(tree).toMatchSnapshot(); }); }); diff --git a/public/components/Modal/Modal.test.tsx b/public/components/Modal/Modal.test.tsx index 3c844a174..04de2cecf 100644 --- a/public/components/Modal/Modal.test.tsx +++ b/public/components/Modal/Modal.test.tsx @@ -8,13 +8,13 @@ import { EuiButton, EuiOverlayMask, EuiModal } from '@elastic/eui'; import { render, fireEvent } from '@testing-library/react'; import ModalRoot from './ModalRoot'; import { ModalConsumer, ModalProvider } from './Modal'; -import { ServicesConsumer, ServicesContext } from '../../services/Services'; -import { browserServicesMock } from '../../../test/mocks'; +import { ServicesConsumer, ServicesContext } from '../../services'; +import services from '../../../test/mocks/services'; describe(' spec', () => { it('renders nothing when not used', () => { const { container } = render( - + {(services) => services && } @@ -34,7 +34,7 @@ describe(' spec', () => { ); const { queryByText, getByTestId, getByLabelText } = render(
- + {(services) => services && } diff --git a/public/pages/Alerts/components/AlertFlyout/AlertFlyout.test.tsx b/public/pages/Alerts/components/AlertFlyout/AlertFlyout.test.tsx new file mode 100644 index 000000000..75f1d974e --- /dev/null +++ b/public/pages/Alerts/components/AlertFlyout/AlertFlyout.test.tsx @@ -0,0 +1,16 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import { AlertFlyout } from './AlertFlyout'; +import alertFlyoutMock from '../../../../../test/mocks/Alerts/components/AlertFlyout/AlertFlyout.mock'; + +describe(' spec', () => { + it('renders the component', () => { + const { container } = render(); + expect(container).toMatchSnapshot(); + }); +}); diff --git a/public/pages/Alerts/components/AlertFlyout/__snapshots__/AlertFlyout.test.tsx.snap b/public/pages/Alerts/components/AlertFlyout/__snapshots__/AlertFlyout.test.tsx.snap new file mode 100644 index 000000000..025af3ff5 --- /dev/null +++ b/public/pages/Alerts/components/AlertFlyout/__snapshots__/AlertFlyout.test.tsx.snap @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` spec renders the component 1`] = ` +