Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

ComposerPendingApprovalPanel.test.tsx

28 lines1.0 KB

1import { ApprovalRequestId } from "@t3tools/contracts";
2import { renderToStaticMarkup } from "react-dom/server";
3import { describe, expect, it } from "vite-plus/test";
4​
5import { ComposerPendingApprovalPanel } from "./ComposerPendingApprovalPanel";
6​
7describe("ComposerPendingApprovalPanel", () => {
8 it("renders complete multiline command details without hover or truncation", () => {
9 const detail = `bun run release -- ${"long-argument ".repeat(20)}\nsecond line`;
10 const markup = renderToStaticMarkup(
11 <ComposerPendingApprovalPanel
12 approval={{
13 requestId: ApprovalRequestId.make("approval-1"),
14 requestKind: "command",
15 createdAt: "2026-07-18T00:00:00.000Z",
16 detail,
17 }}
18 pendingCount={1}
19 />,
20 );
21​
22 expect(markup).toContain('data-approval-detail="complete"');
23 expect(markup).toContain('aria-label="Command"');
24 expect(markup).toContain(detail);
25 expect(markup).not.toContain("truncate");
26 expect(markup).not.toContain("line-clamp");
27 });
28});