import { describe, expect, test } from "bun:test"; import { renderToStaticMarkup } from "react-dom/server"; import { getPanelDestinations, handlePanelEscape, PanelEmpty, } from "../src/react-app/domains/session/panel/panel-empty"; import { getSidePanelSessionKey, NO_SESSION_SIDE_PANEL_KEY, } from "../src/react-app/domains/session/panel/side-panel-session"; describe("right panel empty state", () => { test("keeps the panel addressable before a session exists", () => { expect(getSidePanelSessionKey(null)).toBe(NO_SESSION_SIDE_PANEL_KEY); expect(getSidePanelSessionKey("")).toBe(NO_SESSION_SIDE_PANEL_KEY); expect(getSidePanelSessionKey(" ")).toBe(NO_SESSION_SIDE_PANEL_KEY); expect(getSidePanelSessionKey("ses_existing")).toBe("ses_existing"); }); test("renders spacious keyboard-accessible destination actions", () => { const html = renderToStaticMarkup( undefined} onOpenExtensions={() => undefined} onOpenVoice={() => undefined} />, ); expect(html).toContain("Choose a destination"); expect(html).toContain("Browser"); expect(html).toContain("Files & artifacts"); expect(html).toContain("Library"); expect(html).toContain("Voice Mode"); expect(html).toContain('aria-label="Panel destinations"'); expect(html.match(/