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 liveAgentCount={0}
18 onToggleTerminal={() => {}}
19 onToggleRightPanel={() => {}}
20 />,
21 );
22
23 expect(markup.match(/data-slot="tooltip-trigger"/g)).toHaveLength(2);
24 expect(markup.match(/data-slot="tooltip-trigger"[^>]*><button[^>]*disabled=""/g)).toHaveLength(
25 2,
26 );
27 });
28});