diff --git a/public/pages/workflow_detail/resizable_workspace.test.tsx b/public/pages/workflow_detail/resizable_workspace.test.tsx new file mode 100644 index 00000000..08d71b40 --- /dev/null +++ b/public/pages/workflow_detail/resizable_workspace.test.tsx @@ -0,0 +1,41 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import { Provider } from 'react-redux'; +import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; +import { store } from '../../store'; +import { ResizableWorkspace } from './resizable_workspace'; +global.ResizeObserver = class { + observe() {} + unobserve() {} + disconnect() {} +}; +jest.mock('../../services', () => { + const { mockCoreServices } = require('../../../test'); + return { + ...jest.requireActual('../../services'), + ...mockCoreServices, + }; +}); + +const renderWithRouter = () => + render( + + + + } /> + + + + ); + +describe('ResizableWorkspace', () => { + test('renders the page', () => { + const { getAllByText } = renderWithRouter(); + expect(getAllByText('Manage existing workflows').length).toBeGreaterThan(0); + }); +}); diff --git a/public/pages/workflow_detail/resizable_workspace.tsx b/public/pages/workflow_detail/resizable_workspace.tsx index 8c089c06..1d6b1351 100644 --- a/public/pages/workflow_detail/resizable_workspace.tsx +++ b/public/pages/workflow_detail/resizable_workspace.tsx @@ -4,7 +4,6 @@ */ import React, { useRef, useState, useEffect } from 'react'; -import { useSelector } from 'react-redux'; import { Form, Formik } from 'formik'; import * as yup from 'yup'; import {