Skip to content

test(web): fix the flaky ConnectPage focus assertions #1201

Closed

Description

@mforce

web/src/routes/ConnectPage.test.tsx fails at random on focus assertions. The usual one is ConnectPage (#798, consent D) > starts a reconnect at the request too, which fails with expect(element).toHaveFocus().

It failed three times on 2026-10-10, on PRs that do not touch ConnectPage (including #1189 and #1193), and passed each time on a re-run of the failed job. Example: run 38091057293 on #1193 (1 failed, 3801 passed).

Likely cause: the test asserts focus before an async state change or portal commit has settled. Fix it with a waitFor/findBy on the focus target, or by awaiting the action that moves focus, and do not add retries.

Done when: the test passes 20 runs in a row under CI-like load (--maxWorkers=2).

Activity

  1. added this to the Platform hardening milestone on Oct 10, 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

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions