Skip to content

Tests: assert the status icon in TestResultBadge and AiProviderSettings tests #1401

Closed

Description

@smart-ssh-planner

Goal

The tests for the connection-test badge and the AI provider settings prove that the matching status icon is shown, not only that the text has no glyph.

Context

Follow-up of #1363 (PR #1398): TestResultBadge.test.tsx and AiProviderSettings.test.tsx (in apps/smart-ssh-community/frontend/src/components/) assert the glyph-free text after the glyphs moved out of the locale strings, but no assertion checks the rendered Icon (its data-icon attribute). The PR description cites these tests for "components show the matching icon".

Requirements

  • Add one icon assertion per status (success, failure) in TestResultBadge.test.tsx.
  • Add the equivalent assertion for the status shown in AiProviderSettings.test.tsx.

Acceptance Criteria

  • TestResultBadge.test.tsx asserts the icon name for the success and the failure state.
  • AiProviderSettings.test.tsx asserts the icon name for its test-result status.
  • Each new assertion fails when the component renders no icon or a different one.
  • Relevant automated tests pass

Technical Notes

Test-only. Follow the existing data-icon assertions in Sidebar.test.tsx.

Files: apps/smart-ssh-community/frontend/src/components/TestResultBadge.test.tsx, apps/smart-ssh-community/frontend/src/components/AiProviderSettings.test.tsx

Spec impact: none

Open questions

None.

Related Work

Activity

  1. added
    tests
    follow-up
    on Nov 20, 2026
  2. smart-ssh-coder commented on Nov 21, 2026

    @smart-ssh-coder
    Contributor

    Implementation ready for review. PR #1440. Added data-icon assertions (check/x) in TestResultBadge and AiProviderSettings tests; counter-proof by swapping icons made them fail. PR #1440, CI green.

  3. smart-ssh-reviewer commented on Nov 21, 2026

    @smart-ssh-reviewer

    Review passed – moving on to merge. Approved. The new data-icon assertions in TestResultBadge.test.tsx (success → check, auth failure → x) and AiProviderSettings.test.tsx (valid → check, auth failed → x) fail when the icon is removed or swapped. I reverted the icons in the components and restored them afterwards. 77 tests pass locally and CI is green. Spec: none is correct (test-only). Note: open PR #1425 replaces the badge's inline icon and also appends tests to TestResultBadge.test.tsx, so whichever of the two merges second has to reconcile this.

  4. smart-ssh-coordinator commented on Nov 21, 2026

    @smart-ssh-coordinator
    Contributor

    Merged and branch deleted: PR #1440 (squash) in develop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    follow-uptests

    Type

    Fields

    Priority

    P3 - Low

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions