Skip to content

test: add error-handling and sensitive key protection tests for ApiKeySetupModal (#1411)#1720

Open
Rakshak05 wants to merge 4 commits into
utksh1:mainfrom
Rakshak05:issue-#1411
Open

test: add error-handling and sensitive key protection tests for ApiKeySetupModal (#1411)#1720
Rakshak05 wants to merge 4 commits into
utksh1:mainfrom
Rakshak05:issue-#1411

Conversation

@Rakshak05

Copy link
Copy Markdown
Contributor

Description

This PR adds unit tests for ApiKeySetupModal to verify robust error-handling behavior when the API key setup fails. The new tests verify:

  • Accurate rendering of the dialog UI under standard conditions.
  • Validation message triggering on empty key submissions.
  • Rendering of backend-provided error messages upon validation rejection.
  • Prevention of sensitive key exposure: checking that the sensitive API key text is never echoed back in the failure alert UI or printed to console streams (console.log, console.warn, console.error).

Related Issues

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

We validated these changes by executing the unit tests locally:

  1. Navigated to frontend
  2. Ran: npm run test -- ApiKeySetupModal.test.tsx
  3. All 5 tests passed successfully.

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

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.

[TEST] Add ApiKeySetupModal error-handling tests

1 participant