import { describe, expect, it } from "vitest"; import { renderToStaticMarkup } from "react-dom/server"; import { CalendarDays } from "lucide-react"; import { stripDayOf } from "@/components/day/day-url"; import { dayYields, listYields, BOTH_PANELS_QUERY, } from "@/components/insights/coach-panel/conversations-panel"; import { DOCK_SLIDE, DockStrip } from "../shell-dock"; /** * The docked panels' strips (v1.42). Each docked panel keeps its own strip * at the right edge; the strip is a toggle for its panel, never moves, and * below 1600 px only one panel is open. The click paths, focus and the * geometry run in `e2e/dock-strips.spec.ts`. */ function strip(expanded: boolean) { return renderToStaticMarkup( {}} data={{ "data-day": "2026-06-04" }} />, ); } describe("DockStrip", () => { it("is a toggle button for its panel, closed", () => { const html = strip(false); expect(html).toContain('data-slot="day-strip"'); expect(html).toContain('data-state="closed"'); expect(html).toContain('data-day="2026-06-04"'); expect(html).toMatch(/]*type="button"/); expect(html).toContain('data-slot="day-strip-toggle"'); expect(html).toContain('aria-expanded="false"'); expect(html).toContain('aria-controls="day-docked-panel"'); expect(html).toContain('aria-label="Show Thursday, 4 June 2026"'); // The label reads top to bottom. expect(html).toContain("[writing-mode:vertical-rl]"); expect(html).toContain("Thu, 4 Jun 2026"); }); it("says it is open and what a click does then", () => { const html = strip(true); expect(html).toContain('data-state="open"'); expect(html).toContain('aria-expanded="true"'); expect(html).toContain('aria-label="Hide day"'); }); it("keeps the same shape open and closed, below the top bar's band", () => { const shape = (html: string) => html.match(/^]*class="([^"]*)"/)![1]; expect(shape(strip(true))).toBe(shape(strip(false))); expect(shape(strip(false))).toContain("w-10"); // The first cell is the band (`SHELL_HEADER_BAND`), empty and hidden. expect(strip(false)).toMatch( /^]*>