Skip to content

test(ui): tighten connection-indicator regression tests (follow-up to #273) #274

@sanity

Description

@sanity

Follow-ups from the multi-model review of PR #273 (Bug #5: WebSocket connection indicator on no-rooms screen). All Important / Suggestion level — non-blocking, but worth picking up.

Items

Important

  1. Assert exactly ONE pill is visible at each viewport. Both placements (RoomList always-visible + Conversation no-room inline) share data-testid="connection-status-indicator". The current spec uses :visible + .first(), which masks the regression where md:hidden accidentally inverts (or the Tailwind v4 @source "../src/**/*.rs" directive gets dropped — see AGENTS.md). Add await expect(page.locator(PILL_TESTID)).toHaveCount(1) at desktop (1280px) AND mobile (375x812).

  2. State-transition coverage. All four current tests assert "Connecting..." at initial paint. A regression that replaces try_read() with peek() (no subscription at all per Dioxus 0.7.x) would leave the pill stuck and not be caught. Either assert the dot's bg-color class so a stuck-state regression is detectable, or drive a state transition via test fixture.

Suggestion

  1. Tighten waitForApp selector — expect(page.locator(\"aside, .app-root button\")).not.toHaveCount(0) matches any button. Should wait for the rail itself.

  2. Run the new spec across webkit and mobile-safari projects too — Firefox-mobile is where the try_read() rule originated.

  3. Consider a data-testid=\"rooms-rail\" instead of hasText: 'Rooms' for the rail-membership assertion — text changes break it brittle-ly.

Context

[AI-assisted - Claude]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions