From d14a67e26df59bfb02ee16a8da26a3ea3ea01c79 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 11:15:23 -0800 Subject: [PATCH] Public Components Snapshot Tests (#218) (#234) Signed-off-by: Sinisa Andric Signed-off-by: Sinisa Andric (cherry picked from commit 9136293ed36b86f1870a1b587a764d0604829306) Co-authored-by: Sinisa Andric Signed-off-by: AWSHurneyt --- .../DeleteModal/DeleteModal.test.tsx | 22 +++ .../__snapshots__/DeleteModal.test.tsx.snap | 184 ++++++++++++++++++ .../FormFieldHeader/FormFieldHeader.test.tsx | 15 ++ .../FormFieldHeader.test.tsx.snap | 78 ++++++++ .../NotificationsCallOut.test.tsx | 15 ++ .../NotificationsCallOut.test.tsx.snap | 138 +++++++++++++ 6 files changed, 452 insertions(+) create mode 100644 public/components/DeleteModal/DeleteModal.test.tsx create mode 100644 public/components/DeleteModal/__snapshots__/DeleteModal.test.tsx.snap create mode 100644 public/components/FormFieldHeader/FormFieldHeader.test.tsx create mode 100644 public/components/FormFieldHeader/__snapshots__/FormFieldHeader.test.tsx.snap create mode 100644 public/components/NotificationsCallOut/NotificationsCallOut.test.tsx create mode 100644 public/components/NotificationsCallOut/__snapshots__/NotificationsCallOut.test.tsx.snap diff --git a/public/components/DeleteModal/DeleteModal.test.tsx b/public/components/DeleteModal/DeleteModal.test.tsx new file mode 100644 index 000000000..4a187ea45 --- /dev/null +++ b/public/components/DeleteModal/DeleteModal.test.tsx @@ -0,0 +1,22 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import DeleteModal from './DeleteModal'; + +describe(' spec', () => { + it('renders the component', () => { + const tree = render( + jest.fn()} + ids={'some ids'} + onClickDelete={() => jest.fn()} + type={'some type'} + /> + ); + expect(tree).toMatchSnapshot(); + }); +}); diff --git a/public/components/DeleteModal/__snapshots__/DeleteModal.test.tsx.snap b/public/components/DeleteModal/__snapshots__/DeleteModal.test.tsx.snap new file mode 100644 index 000000000..b53356b0f --- /dev/null +++ b/public/components/DeleteModal/__snapshots__/DeleteModal.test.tsx.snap @@ -0,0 +1,184 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` spec renders the component 1`] = ` +Object { + "asFragment": [Function], + "baseElement": +