-
Notifications
You must be signed in to change notification settings - Fork 3
test: added tests for mcp and workspace deletion #356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
useManagedControlPlanesQueryanduseDeleteManagedControlPlanehooks to encapsulate data fetching and deletion logic - Removed unused
isDeletingreturn value fromuseDeleteWorkspacehook - 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.
src/components/ControlPlanes/List/ControlPlaneListWorkspaceGridTile.cy.tsx
Outdated
Show resolved
Hide resolved
…dTile.cy.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this 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.
This PR adds tests for: