import { readFileSync } from "node:fs"; import { join } from "node:path"; import { createElement } from "react"; import { renderToStaticMarkup } from "react-dom/server"; import { describe, expect, it } from "vitest"; import { StageEntryActions } from "../src/client/components/StageEntryActions.tsx"; describe("Host stage entry layout", () => { it("keeps disclosure as the immediate sibling after the fixed action row", () => { const closed = renderToStaticMarkup( createElement(StageEntryActions, { joiningRoom: false, onJoinToggle: () => undefined, onStartSharing: () => undefined, }), ); const open = renderToStaticMarkup( createElement(StageEntryActions, { joiningRoom: true, onJoinToggle: () => undefined, onStartSharing: () => undefined, }), ); expect(closed.match(/class="entry-action"/g)).toHaveLength(2); expect(open.match(/class="entry-action"/g)).toHaveLength(2); expect(open).toMatch( /class="entry-actions"[\s\S]*?<\/div>