Skip to content

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

Merged
utksh1 merged 1 commit into
utksh1:mainfrom
Rakshak05:issue-#1411
Jul 13, 2026
Merged

test: add error-handling and sensitive key protection tests for ApiKeySetupModal (#1411)#1720
utksh1 merged 1 commit 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.

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The frontend modal tests are mostly useful, but this PR is not mergeable as-is because it carries unrelated backend/parser-sandbox changes.\n\n1. Remove the unrelated backend parser_sandbox changes and keep this PR focused on ApiKeySetupModal tests only.\n2. Keep the useful error-handling and non-echo behavior tests, but trim any over-claimed assertions that do not protect a meaningful regression boundary.\n\nPlease push a focused frontend-only revision and I’ll re-review it.

@utksh1 utksh1 added type:testing Testing work category bonus label area:frontend Frontend React/UI work level:beginner 20 pts difficulty label for small beginner-friendly PRs labels Jul 7, 2026

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Approved after follow-up changes narrowed the scope and CI is green.

@utksh1
utksh1 merged commit d69bf82 into utksh1:main Jul 13, 2026
21 checks passed
@utksh1 utksh1 added the gssoc:approved Admin validation: approved for GSSoC scoring label Jul 13, 2026
@Rakshak05
Rakshak05 deleted the issue-#1411 branch July 13, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:frontend Frontend React/UI work gssoc:approved Admin validation: approved for GSSoC scoring level:beginner 20 pts difficulty label for small beginner-friendly PRs type:testing Testing work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TEST] Add ApiKeySetupModal error-handling tests

2 participants