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
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
import "@testing-library/jest-dom/vitest";
|
|
import { render, screen } from "@testing-library/react";
|
|
import { describe, expect, it, vi } from "vitest";
|
|
import { AgentComposerDraftImagePreview } from "./AgentComposerDraftPreview";
|
|
|
|
describe("AgentComposerDraftImagePreview", () => {
|
|
it("does not render an image element before a restored preview is hydrated", () => {
|
|
const { container, rerender } = render(
|
|
<AgentComposerDraftImagePreview
|
|
image={{
|
|
id: "restored-image",
|
|
mimeType: "image/png",
|
|
name: "image.png",
|
|
path: "/agent-prompt-assets/image.png",
|
|
previewUrl: ""
|
|
}}
|
|
onRemove={vi.fn()}
|
|
removeLabel="Remove"
|
|
/>
|
|
);
|
|
|
|
expect(
|
|
screen.getByTestId("agent-gui-composer-image-preview-pending")
|
|
).toBeInTheDocument();
|
|
expect(container.querySelector("img")).toBeNull();
|
|
|
|
rerender(
|
|
<AgentComposerDraftImagePreview
|
|
image={{
|
|
id: "restored-image",
|
|
mimeType: "image/png",
|
|
name: "image.png",
|
|
path: "/agent-prompt-assets/image.png",
|
|
previewUrl: "data:image/png;base64,cmVzdG9yZWQ="
|
|
}}
|
|
onRemove={vi.fn()}
|
|
removeLabel="Remove"
|
|
/>
|
|
);
|
|
|
|
expect(container.querySelector("img")).toHaveAttribute(
|
|
"src",
|
|
"data:image/png;base64,cmVzdG9yZWQ="
|
|
);
|
|
});
|
|
});
|