import { beforeEach, describe, expect, it } from "vitest"; import { consumeStudioLaunchContext, saveStudioLaunchContext } from "@/lib/presenter"; describe("studio launch context handoff", () => { beforeEach(() => { window.sessionStorage.clear(); }); it("saves and consumes curriculum/teleprompter studio launch context once", () => { saveStudioLaunchContext({ title: "Day 1: Baseline Tech Self-Intro", mode: "Pitch", curriculumDay: 1, teleprompterScript: "Hi, I build reliable cloud tools.", bulletCues: ["Hook", "Problem", "Impact"], targetKeywords: ["reliable", "cloud"], teleprompterMode: "scroll", targetSeconds: 60, }); const firstRead = consumeStudioLaunchContext(); expect(firstRead?.curriculumDay).toBe(1); expect(firstRead?.teleprompterMode).toBe("scroll"); expect(firstRead?.bulletCues).toHaveLength(3); const secondRead = consumeStudioLaunchContext(); expect(secondRead).toBeNull(); }); });