test(AttachmentViews): add tone=user/agent class tests + one-button guard
Added to existing suite: - tone=user applies blue-400 accent class - tone=agent omits blue-400 accent class - PendingAttachmentPill: exactly one button rendered (no stray targets) Brings total from 14 → 17 cases, closing the gap with issue #594. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
323a81034a
commit
f3b4e67c0a
@ -104,6 +104,7 @@ describe("PendingAttachmentPill", () => {
|
||||
);
|
||||
expect(container.querySelectorAll("button")).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// ─── AttachmentChip ───────────────────────────────────────────────────────────
|
||||
@ -182,4 +183,30 @@ describe("AttachmentChip", () => {
|
||||
);
|
||||
expect(container.querySelectorAll("button")).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("tone=user applies blue-400 accent class", () => {
|
||||
const attachment = makeAttachment("file.pdf", 512);
|
||||
render(
|
||||
<AttachmentChip
|
||||
attachment={attachment}
|
||||
onDownload={vi.fn()}
|
||||
tone="user"
|
||||
/>
|
||||
);
|
||||
const btn = screen.getByRole("button");
|
||||
expect(btn.className).toMatch(/blue-400/);
|
||||
});
|
||||
|
||||
it("tone=agent omits blue-400 accent class", () => {
|
||||
const attachment = makeAttachment("file.pdf", 512);
|
||||
render(
|
||||
<AttachmentChip
|
||||
attachment={attachment}
|
||||
onDownload={vi.fn()}
|
||||
tone="agent"
|
||||
/>
|
||||
);
|
||||
const btn = screen.getByRole("button");
|
||||
expect(btn.className).not.toMatch(/blue-400/);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user