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()