mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-12 06:10:44 +01:00
test(ui): retire duplicate IssueChatThread render cases (#16092)
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
ae6e701821
commit
522619744b
2 files changed
+86
-55
No files matched your search
@@ -453,6 +453,11 @@ describe("IssueChatThread", () => {
|
||||
});
|
||||
});
|
||||
|
||||
const spacer = container.querySelector(
|
||||
'[data-testid="issue-chat-bottom-spacer"]',
|
||||
);
|
||||
expect(spacer).toBeNull();
|
||||
|
||||
expect(container.textContent).toContain("Jump to latest");
|
||||
expect(container.textContent).not.toContain("Chat (");
|
||||
|
||||
@@ -3142,42 +3147,6 @@ describe("IssueChatThread", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps the composer floating with a capped editor height", () => {
|
||||
const root = createRoot(container);
|
||||
|
||||
act(() => {
|
||||
renderIssueThread(root);
|
||||
});
|
||||
|
||||
const dock = container.querySelector(
|
||||
'[data-testid="issue-chat-composer-dock"]',
|
||||
) as HTMLDivElement | null;
|
||||
expect(dock).not.toBeNull();
|
||||
expect(dock?.className).toContain("sticky");
|
||||
expect(dock?.className).toContain("bottom-(--sz-calc-8)");
|
||||
expect(dock?.className).toContain("z-20");
|
||||
|
||||
const composer = container.querySelector(
|
||||
'[data-testid="issue-chat-composer"]',
|
||||
) as HTMLDivElement | null;
|
||||
expect(composer).not.toBeNull();
|
||||
expect(composer?.className).toContain("rounded-md");
|
||||
expect(composer?.className).not.toContain("rounded-lg");
|
||||
expect(composer?.className).toContain("p-(--sz-15px)");
|
||||
|
||||
const editor = container.querySelector(
|
||||
'textarea[aria-label="Issue chat editor"]',
|
||||
) as HTMLTextAreaElement | null;
|
||||
expect(editor?.dataset.contentClassName).toContain("max-h-(--sz-28dvh)");
|
||||
expect(editor?.dataset.contentClassName).toContain("overflow-y-auto");
|
||||
expect(editor?.dataset.contentClassName).not.toContain("min-h-(--sz-72px)");
|
||||
expect(editor?.dataset.fileDropTarget).toBe("parent");
|
||||
|
||||
act(() => {
|
||||
root.unmount();
|
||||
});
|
||||
});
|
||||
|
||||
it("shows full-composer drop instructions while dragging files over the issue composer", () => {
|
||||
const root = createRoot(container);
|
||||
|
||||
@@ -3679,25 +3648,6 @@ describe("IssueChatThread", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("omits the bottom spacer when the composer is hidden", () => {
|
||||
const root = createRoot(container);
|
||||
|
||||
act(() => {
|
||||
renderIssueThread(root, {
|
||||
showComposer: false,
|
||||
});
|
||||
});
|
||||
|
||||
const spacer = container.querySelector(
|
||||
'[data-testid="issue-chat-bottom-spacer"]',
|
||||
);
|
||||
expect(spacer).toBeNull();
|
||||
|
||||
act(() => {
|
||||
root.unmount();
|
||||
});
|
||||
});
|
||||
|
||||
it("hides the reopen control and infers reopen for closed agent-assigned issue replies", async () => {
|
||||
const root = createRoot(container);
|
||||
const onAdd = vi.fn().mockResolvedValue(undefined);
|
||||
@@ -4016,6 +3966,30 @@ describe("IssueChatThread", () => {
|
||||
renderIssueThread(root);
|
||||
});
|
||||
|
||||
const dock = container.querySelector(
|
||||
'[data-testid="issue-chat-composer-dock"]',
|
||||
) as HTMLDivElement | null;
|
||||
expect(dock).not.toBeNull();
|
||||
expect(dock?.className).toContain("sticky");
|
||||
expect(dock?.className).toContain("bottom-(--sz-calc-8)");
|
||||
expect(dock?.className).toContain("z-20");
|
||||
|
||||
const composer = container.querySelector(
|
||||
'[data-testid="issue-chat-composer"]',
|
||||
) as HTMLDivElement | null;
|
||||
expect(composer).not.toBeNull();
|
||||
expect(composer?.className).toContain("rounded-md");
|
||||
expect(composer?.className).not.toContain("rounded-lg");
|
||||
expect(composer?.className).toContain("p-(--sz-15px)");
|
||||
|
||||
const editor = container.querySelector(
|
||||
'textarea[aria-label="Issue chat editor"]',
|
||||
) as HTMLTextAreaElement | null;
|
||||
expect(editor?.dataset.contentClassName).toContain("max-h-(--sz-28dvh)");
|
||||
expect(editor?.dataset.contentClassName).toContain("overflow-y-auto");
|
||||
expect(editor?.dataset.contentClassName).not.toContain("min-h-(--sz-72px)");
|
||||
expect(editor?.dataset.fileDropTarget).toBe("parent");
|
||||
|
||||
act(() => {
|
||||
renderIssueThread(root, {
|
||||
liveRuns: [
|
||||
|
||||
Reference in new issue
Block a user