diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/EntitySummaryDetails/EntitySummaryDetails.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/EntitySummaryDetails/EntitySummaryDetails.test.tsx
index 62592badda0..553af0fdfac 100644
--- a/openmetadata-ui/src/main/resources/ui/src/components/common/EntitySummaryDetails/EntitySummaryDetails.test.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/components/common/EntitySummaryDetails/EntitySummaryDetails.test.tsx
@@ -11,9 +11,9 @@
* limitations under the License.
*/
-import { findByTestId, render } from '@testing-library/react';
+import { act, findByTestId, render, screen } from '@testing-library/react';
+import userEvent from '@testing-library/user-event';
import React from 'react';
-import { act } from 'react-test-renderer';
import EntitySummaryDetails from './EntitySummaryDetails';
const mockData = {
@@ -69,4 +69,34 @@ describe('EntitySummaryDetails Component', () => {
expect(EntitySummary).toBeInTheDocument();
});
});
+
+ it('Edit team type should render the appropriate component', async () => {
+ render(
+
+ );
+
+ const editTeamTypeBtn = screen.getByTestId('edit-TeamType-icon');
+
+ await act(async () => {
+ userEvent.click(editTeamTypeBtn);
+ });
+
+ // should show the team type select box and action buttons
+ expect(screen.getByTestId('team-type-select')).toBeInTheDocument();
+
+ const cancelBtn = screen.getByTestId('cancel-btn');
+ const saveBtn = screen.getByTestId('save-btn');
+
+ expect(cancelBtn).toBeInTheDocument();
+ expect(saveBtn).toBeInTheDocument();
+
+ // should hide the team type select box and action buttons after save
+ await act(async () => {
+ userEvent.click(saveBtn);
+ });
+
+ expect(screen.queryByTestId('team-type-select')).toBeNull();
+ expect(screen.queryByTestId('cancel-btn')).toBeNull();
+ expect(screen.queryByTestId('save-btn')).toBeNull();
+ });
});
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/EntitySummaryDetails/EntitySummaryDetails.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/EntitySummaryDetails/EntitySummaryDetails.tsx
index 4025e10678f..35f0d0438e1 100644
--- a/openmetadata-ui/src/main/resources/ui/src/components/common/EntitySummaryDetails/EntitySummaryDetails.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/components/common/EntitySummaryDetails/EntitySummaryDetails.tsx
@@ -83,6 +83,11 @@ const EntitySummaryDetails = ({
setShowTypeSelector(value);
}, []);
+ const handleUpdateTeamType = (type: TeamType) => {
+ updateTeamType?.(type);
+ handleShowTypeSelector(false);
+ };
+
const ownerDropdown = allowTeamOwner ? (
) : (
<>
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/TeamTypeSelect/TeamTypeSelect.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/TeamTypeSelect/TeamTypeSelect.component.tsx
index f0d3f7749cb..b36d8fde876 100644
--- a/openmetadata-ui/src/main/resources/ui/src/components/common/TeamTypeSelect/TeamTypeSelect.component.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/components/common/TeamTypeSelect/TeamTypeSelect.component.tsx
@@ -42,7 +42,11 @@ function TeamTypeSelect({
const options = useMemo(() => getTeamTypeOptions(showGroupOption), []);
return (
-
+
- } onClick={handleCancel} />
- } onClick={handleSubmit} />
+ }
+ onClick={handleCancel}
+ />
+ }
+ onClick={handleSubmit}
+ />
);