From 8cd8417de951b00b4d6d6dcda43476ba07542b09 Mon Sep 17 00:00:00 2001 From: Simeon Widdis Date: Mon, 10 Jun 2024 12:10:57 -0700 Subject: [PATCH] Add tests for new functionality Signed-off-by: Simeon Widdis --- .../integration_header.test.tsx.snap | 118 ++++++++++++++++++ .../__snapshots__/upload_flyout.test.tsx.snap | 75 +++++++++++ .../__tests__/upload_flyout.test.tsx | 36 ++++++ 3 files changed, 229 insertions(+) create mode 100644 public/components/integrations/components/__tests__/__snapshots__/upload_flyout.test.tsx.snap create mode 100644 public/components/integrations/components/__tests__/upload_flyout.test.tsx diff --git a/public/components/integrations/components/__tests__/__snapshots__/integration_header.test.tsx.snap b/public/components/integrations/components/__tests__/__snapshots__/integration_header.test.tsx.snap index 41591c2408..574594d3a5 100644 --- a/public/components/integrations/components/__tests__/__snapshots__/integration_header.test.tsx.snap +++ b/public/components/integrations/components/__tests__/__snapshots__/integration_header.test.tsx.snap @@ -24,6 +24,124 @@ exports[`Integration Header Test Renders integration header as expected 1`] = ` + +
+ + + Catalog + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + id="integHeaderActionsPanel" + isOpen={false} + ownFocus={true} + panelPaddingSize="none" + > +
+
+ + + + + +
+
+
+
+
+
+ + Upload Integrations + + + + + + + + + Cancel + + + + + Upload + + + + + +`; + +exports[`Integration Upload Flyout Renders the clean integration picker as expected 1`] = ` + + + + + +`; diff --git a/public/components/integrations/components/__tests__/upload_flyout.test.tsx b/public/components/integrations/components/__tests__/upload_flyout.test.tsx new file mode 100644 index 0000000000..82037a8fd9 --- /dev/null +++ b/public/components/integrations/components/__tests__/upload_flyout.test.tsx @@ -0,0 +1,36 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { configure, shallow } from 'enzyme'; +import Adapter from 'enzyme-adapter-react-16'; +import React from 'react'; +import { waitFor } from '@testing-library/react'; +import { IntegrationUploadFlyout, IntegrationUploadPicker } from '../upload_flyout'; + +describe('Integration Upload Flyout', () => { + configure({ adapter: new Adapter() }); + + it('Renders integration upload flyout as expected', async () => { + const wrapper = shallow( {}} />); + + await waitFor(() => { + expect(wrapper).toMatchSnapshot(); + }); + }); + + it('Renders the clean integration picker as expected', async () => { + const wrapper = shallow( + {}} + onFileSelected={(_) => {}} + /> + ); + + await waitFor(() => { + expect(wrapper).toMatchSnapshot(); + }); + }); +});