Skip to content

test(frontend): assert status icons in TestResultBadge and AiProviderSettings - #1440

Merged
smart-ssh-coordinator[bot] merged 1 commit into
developfrom
issue-1401-tests-assert-the-status-icon-in
Nov 21, 2026
Merged

smart-ssh-coordinator[bot] merged 1 commit into
developfrom
issue-1401-tests-assert-the-status-icon-in

Conversation

@smart-ssh-coder

Copy link
Copy Markdown
Contributor

Closes #1401

Summary

Test-only: asserts the rendered Icon (data-icon) for the connection-test badge and the AI provider credentials-test result.

Acceptance Criteria

  • TestResultBadge.test.tsx asserts icon for success and failure: met (renders the check icon for the success state, renders the x icon for the failure state)
  • AiProviderSettings.test.tsx asserts icon for its test result: met (shows a valid result → check, shows an authentication-failed result → x)
  • Assertions fail on a missing/different icon: met (see counter-proof)
  • Relevant automated tests pass: met

Tests

Counter-proof: swapping the icon names in the components made 3 of the new/extended tests fail; restored afterwards.

Assumptions

None.

Spec: none (test-only)
Threat model: no change – tests only
Manual test steps: none
Follow-ups: None.

🤖 Generated with Claude Code

…Settings (#1401)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@smart-ssh-reviewer smart-ssh-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review

Verdict: approved
Review level: normal

Blocking

  • None.

Non-blocking

  • None.

Verified

  • AC 1: TestResultBadge.test.tsx:renders the check icon for the success state (kind: "success" → data-icon="check") and :renders the x icon for the failure state (kind: "authenticationFailed" → data-icon="x"). Both match serverForm/TestResultBadge.tsx. (read)
  • AC 2: AiProviderSettings.test.tsx:shows a valid result → check, :shows an authentication-failed result → x. The assertion is scoped to the <p> returned by findByText, which in AddAiProviderDialog.tsx renders the Icon and the text together. (read)
  • AC 3 / counter-proof: I removed the success icon from TestResultBadge (no icon), swapped the auth-failed icon to warn (different icon), and swapped the credentials-test icons to warn/check in AddAiProviderDialog. All 4 new or extended assertions failed. After restoring the files they passed again and git status was clean. (executed: npx vitest run src/components/TestResultBadge.test.tsx src/components/AiProviderSettings.test.tsx)
  • tests run locally: same command → 77 passed (executed); npx tsc -b → clean (executed)
  • CI: all checks green (executed: gh pr checks 1440)
  • edge cases: no icon → test fails (checked); wrong icon → test fails (checked); the first svg in the badge container is the status icon, since the badge renders only that one icon (read)
  • callers checked: test-only change, no production code touched
  • files read: 2/2 logic files
  • UI: not a UI change (test-only)
  • data: not touched
  • neighbouring work: open PR #1425 also appends tests at the end of TestResultBadge.test.tsx. It also replaces the badge's inline Icon with a Badge. Whichever PR merges second has to reconcile this: either a merge conflict or the new icon assertions. CI on that PR will catch it. This is not a defect of this PR.

Timing analysis

  • 2 test files analysed: no timing dependency found. The badge tests are synchronous renders. In the AI provider tests, the icon and the text appear in the same render after findByText.

Spec

  • visible behaviour changed: none (test-only)
  • spec searched (rg -il 'Verbindungstest|Zugangsdaten testen|test connection' docs/specs/): the area is covered by 0069 and 0050/0056. No change needed.
  • verdict: not needed, because the PR only adds test assertions

Security checks

  • No production code, filter, redaction, credential or execution path is touched. Threat model note "no change – tests only" is fine. PR title, body and commit are in English and contain no internals.

Follow-ups

  • None.

@smart-ssh-coordinator
smart-ssh-coordinator Bot merged commit 7170c7c into develop Nov 21, 2026
10 checks passed
@smart-ssh-coordinator
smart-ssh-coordinator Bot deleted the issue-1401-tests-assert-the-status-icon-in branch November 21, 2026 10:25
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.

Tests: assert the status icon in TestResultBadge and AiProviderSettings tests

0 participants