From 9d8f39bae087c4c1dee3d3a5059745679bc4fbfb Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 18 Feb 2026 18:01:36 +0000 Subject: [PATCH] fix: Add delete confirmation dialog test for CredentialManager component --- .../__tests__/CredentialManager.test.tsx | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/frontend/src/components/__tests__/CredentialManager.test.tsx b/frontend/src/components/__tests__/CredentialManager.test.tsx index e9daa9b0..4b22f0a9 100644 --- a/frontend/src/components/__tests__/CredentialManager.test.tsx +++ b/frontend/src/components/__tests__/CredentialManager.test.tsx @@ -301,6 +301,30 @@ describe('CredentialManager', () => { }) }) + it('opens delete confirmation dialog when delete action is clicked', async () => { + const user = userEvent.setup() + + renderWithClient( + + ) + + const credentialRow = screen.getByText('Main Zone').closest('tr') + expect(credentialRow).not.toBeNull() + + const actionButtons = credentialRow?.querySelectorAll('button') + expect(actionButtons?.[2]).toBeDefined() + + await user.click(actionButtons![2]) + + expect(await screen.findByRole('dialog', { name: 'Delete Credential?' })).toBeInTheDocument() + expect(screen.getByRole('button', { name: 'Delete' })).toBeInTheDocument() + }) + // 5. Validation - Required Fields it('validates required fields on add', async () => { const user = userEvent.setup()