Skip to content

Conversation

@andreaskienle
Copy link
Contributor

@andreaskienle andreaskienle commented Oct 31, 2025

This PR adds tests for:

Copilot AI review requested due to automatic review settings October 31, 2025 10:26
@andreaskienle andreaskienle marked this pull request as draft October 31, 2025 10:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors deletion logic and query hooks for managed control planes by extracting functionality into reusable custom hooks, improving code organization and testability.

Key changes:

  • Created useManagedControlPlanesQuery and useDeleteManagedControlPlane hooks to encapsulate data fetching and deletion logic
  • Removed unused isDeleting return value from useDeleteWorkspace hook
  • Updated components to use the new hooks with dependency injection for testability

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/hooks/useManagedControlPlanesQuery.ts New hook wrapping control planes query logic
src/hooks/useDeleteManagedControlPlane.ts New hook encapsulating managed control plane deletion with patch-then-delete pattern
src/hooks/useDeleteManagedControlPlane.spec.ts Unit tests for the new deletion hook
src/hooks/useDeleteWorkspace.ts Removed unused isDeleting return value
src/components/ControlPlanes/List/ControlPlaneListWorkspaceGridTile.tsx Updated to use new query hook with dependency injection
src/components/ControlPlanes/List/ControlPlaneListWorkspaceGridTile.cy.tsx New Cypress test verifying workspace deletion
src/components/ControlPlanes/ControlPlanesListMenu.tsx Added test ID for E2E testing
src/components/ControlPlanes/ControlPlaneCard/ControlPlaneCard.tsx Refactored to use new deletion hook with dependency injection
src/components/ControlPlanes/ControlPlaneCard/ControlPlaneCard.cy.tsx New Cypress test verifying managed control plane deletion
src/components/ControlPlanes/ControlPlaneCard/ControlPlaneCardMenu.tsx Added test ID for E2E testing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@andreaskienle andreaskienle marked this pull request as ready for review October 31, 2025 10:38
Copy link
Contributor

@Hubert-Szczepanski-SAP Hubert-Szczepanski-SAP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :) Thanks for introducing those tests for workspace deletion - was helpful.

@andreaskienle andreaskienle merged commit 4978b72 into main Oct 31, 2025
5 checks passed
@andreaskienle andreaskienle deleted the test-delete-mcp-ws branch October 31, 2025 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants