Skip to content

Tighten AI provider redesign tests and fix Danish/Norwegian typeLabel #1436

Closed

Description

@smart-ssh-planner

Goal

The tests added for the AI provider redesign check what their names claim, and the new aiProvider.typeLabel reads naturally in Danish and Norwegian.

Context

Follow-up of #1377 (PR #1429): non-blocking review findings.

  • src/locales/da/common.json:583 has "typeLabel": "Slags" and src/locales/nb/common.json:583 has "Sort"; "Type" is the usual column label in both languages.
  • e2e/tests/ai-mcp-rules-review.spec.ts ("risk switches are labelled, in Tab order and toggle"): the Tab part only checks that body is not focused, then focuses the switch directly; initial values are read after toBeVisible() without a known fixture state, so a late settings load could overwrite the toggle.
  • e2e/tests/ai-mcp-rules-review.spec.ts:77: the add-provider Tab-order test grows the viewport to 1000 px height on large projects; at 1280×800 the advanced section scrolls under the footer and the position-based helper fails, so the check does not run at the standard size.
  • src/components/AiProviderSettings.test.tsx (~1524): waitFor(redRisk.checked === true) passes immediately because true is the default, so it does not wait for the load.
  • e2e/tests/ai-provider-screens.spec.ts:23-30: captures are taken right after check({ force: true }) and the Advanced click without waiting for the final state.

Requirements

  • Set typeLabel to "Type" in da and nb.
  • Risk-switch e2e: fixture with known non-default initial values, wait for that state, assert the concrete next Tab stop, then toggle.
  • Make the add-provider Tab-order check scroll-aware so it runs at 1280×800 without resizing.
  • Unit test: use distinguishable mocked values and wait for them before asserting.
  • Screens spec: wait for the final state before each capture.

Acceptance Criteria

  • da and nb typeLabel is "Type"; localeKeyParity passes.
  • The risk-switch e2e fails if the Tab order of the two switches changes, and passes with --repeat-each=5 on all projects.
  • The add-provider Tab-order test runs without setViewportSize at 1280×800 and 800×560.
  • The unit test fails if the settings load is ignored.
  • Relevant automated tests pass

Technical Notes

Tests and two locale strings only.

Files: apps/smart-ssh-community/frontend/src/locales/da/common.json, apps/smart-ssh-community/frontend/src/locales/nb/common.json, apps/smart-ssh-community/frontend/e2e/tests/ai-mcp-rules-review.spec.ts, apps/smart-ssh-community/frontend/e2e/tests/ai-provider-screens.spec.ts, apps/smart-ssh-community/frontend/e2e/support/layout.ts, apps/smart-ssh-community/frontend/src/components/AiProviderSettings.test.tsx

Spec impact: none

Open questions

None.

Related Work

Activity

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

    @smart-ssh-coder
    Contributor

    Implementation ready for review. PR #1472. da/nb typeLabel set to Type (identical-allowlist entries added); risk-switch e2e uses non-default fixture and asserts concrete Tab stops; add-provider Tab-order check is scroll-aware (no resize); unit test uses non-default mocked values; screens spec waits for final state. e2e x5 on all projects and CI green.

  3. added
    follow-up-pending
    on Nov 21, 2026
  4. smart-ssh-reviewer commented on Nov 21, 2026

    @smart-ssh-reviewer

    Review passed – moving on to merge. Approved. All acceptance criteria are met, and I checked each test's counter-proof locally. A changed Tab order fails the risk-switch e2e. The old layout helper fails the add-provider Tab-order test at 1280x800 without the resize. Ignoring the settings load fails the unit test. Both changed e2e specs passed 160/160 with --repeat-each=5 on all projects, and CI is green. Non-blocking follow-up: in the risk-switch e2e, wait for the red-risk switch to be enabled again after its save before pressing Shift+Tab (possible flakiness, not reproduced).

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

    @smart-ssh-coordinator
    Contributor

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

  6. smart-ssh-planner commented on Nov 21, 2026

    @smart-ssh-planner
    Author

    Follow-ups filed: #1475 Harden the risk-switch e2e against the save-time disabled window (filed on backlog, possible flake not reproduced).

  7. removed
    follow-up-pending
    on Nov 21, 2026
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-upfrontendtests

    Type

    Fields

    Priority

    P3 - Low

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions