Open History to see the last commit
1import { renderToStaticMarkup } from "react-dom/server";
2import { describe, expect, it } from "vite-plus/test";
3
4import { PanelLayoutControls } from "./PanelLayoutControls";
5
6describe("PanelLayoutControls", () => {
7 it("keeps unavailable panel tooltip triggers interactive", () => {
8 const markup = renderToStaticMarkup(
9 <PanelLayoutControls
10 showTerminalControl
11 terminalAvailable={false}
12 terminalOpen={false}
13 terminalShortcutLabel={null}
14 rightPanelAvailable={false}
15 rightPanelOpen={false}
16 rightPanelShortcutLabel={null}
17 showThreadPanelControl={false}
18 threadPanelOpen={false}
19 threadPanelPresentation="inline"
20 threadPanelShortcutLabel={null}
21 threadPanelHasAttention={false}
22 onToggleThreadPanel={() => {}}
23 liveAgentCount={0}
24 onToggleTerminal={() => {}}
25 onToggleRightPanel={() => {}}
26 />,
27 );
28
29 expect(markup.match(/data-slot="tooltip-trigger"/g)).toHaveLength(2);
30 expect(markup.match(/data-slot="tooltip-trigger"[^>]*><button[^>]*disabled=""/g)).toHaveLength(
31 2,
32 );
33 });
34});