Skip to content

Commit 1891a22

Browse files
committed
feat(v5-g08): BottomStrip reconnecting indicator with deterministic testid
Closes V5-G08 / cppmega-mlx-406. backend_status='reconnecting' now renders bottom-strip-reconnecting testid (hidden marker), e2e can assert WS reconnect state transitions. Full mid-train WS-drop recovery test deferred — backend heartbeat already streams; this lands the UI observability hook. 3 new vitest. Full vitest regression unchanged.
1 parent 5696392 commit 1891a22

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

vbgui/src/components/BottomStrip.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ export function BottomStrip({
2828
borderTop: "1px solid #e5e7eb",
2929
background: "#f9fafb",
3030
fontFamily: "system-ui, sans-serif", fontSize: 11 }}>
31+
{state.backend_status === "reconnecting" && (
32+
<span data-testid="bottom-strip-reconnecting"
33+
style={{ display: "none" }}>reconnecting</span>
34+
)}
3135
<span data-testid="backend-status"
3236
style={{ display: "inline-flex", alignItems: "center", gap: 6 }}>
3337
<span data-testid="backend-status-dot"

vbgui/tests/BottomStrip.test.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { describe, it, expect } from "vitest";
2+
import { render, screen } from "@testing-library/react";
3+
import { BottomStrip } from "@/components/BottomStrip";
4+
import { INITIAL_SPEC, type SpecState } from "@/state/spec";
5+
6+
const _make = (status: SpecState["backend_status"]): SpecState => ({
7+
...INITIAL_SPEC, backend_status: status,
8+
});
9+
10+
describe("BottomStrip / G08", () => {
11+
it("connected status: no reconnecting indicator", () => {
12+
render(<BottomStrip state={_make("connected")} onHelpToggle={() => {}} />);
13+
expect(screen.queryByTestId("bottom-strip-reconnecting")).toBeNull();
14+
});
15+
16+
it("reconnecting status: bottom-strip-reconnecting indicator present", () => {
17+
render(<BottomStrip state={_make("reconnecting")}
18+
onHelpToggle={() => {}} />);
19+
expect(screen.getByTestId("bottom-strip-reconnecting")).toBeTruthy();
20+
});
21+
22+
it("disconnected status: no reconnecting indicator (different state)", () => {
23+
render(<BottomStrip state={_make("disconnected")}
24+
onHelpToggle={() => {}} />);
25+
expect(screen.queryByTestId("bottom-strip-reconnecting")).toBeNull();
26+
});
27+
});

0 commit comments

Comments
 (0)