Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
48 lines
1.5 KiB
TypeScript
48 lines
1.5 KiB
TypeScript
import { cleanup, fireEvent, render, screen } from "@testing-library/react";
|
|
import { TooltipProvider } from "@tutti-os/ui-system";
|
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
import type { AgentGUIAgentTargetInfoRenderer } from "../types";
|
|
import { AgentTargetInfoTooltip } from "./AgentTargetInfoTooltip";
|
|
|
|
afterEach(cleanup);
|
|
|
|
describe("AgentTargetInfoTooltip", () => {
|
|
it("lazily uses the target label when the Host renderer returns null", async () => {
|
|
const renderer: AgentGUIAgentTargetInfoRenderer = vi.fn(() => null);
|
|
|
|
render(
|
|
<TooltipProvider delayDuration={0}>
|
|
<AgentTargetInfoTooltip
|
|
fallbackLabel="Shared Codex"
|
|
renderer={renderer}
|
|
surface="provider-rail"
|
|
target={{
|
|
agentTargetId: "agent:shared",
|
|
label: "Shared Codex",
|
|
provider: "codex",
|
|
ref: { kind: "shared", provider: "codex" },
|
|
targetId: "shared:codex"
|
|
}}
|
|
>
|
|
<button type="button">Agent information</button>
|
|
</AgentTargetInfoTooltip>
|
|
</TooltipProvider>
|
|
);
|
|
|
|
expect(renderer).not.toHaveBeenCalled();
|
|
|
|
fireEvent.pointerMove(
|
|
screen.getByRole("button", { name: "Agent information" }),
|
|
{ pointerType: "mouse" }
|
|
);
|
|
|
|
expect(await screen.findByRole("tooltip")).toHaveTextContent(
|
|
"Shared Codex"
|
|
);
|
|
expect(renderer).toHaveBeenCalledWith({
|
|
surface: "provider-rail",
|
|
target: expect.objectContaining({ agentTargetId: "agent:shared" })
|
|
});
|
|
});
|
|
});
|