mirror of
https://github.com/multica-ai/multica.git
synced 2026-06-17 03:38:32 +02:00
test: use real image markdown in quick-create attachment test
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { forwardRef, useImperativeHandle, useRef, useState, type ReactNode } from "react";
|
||||
import { describe, it, expect, vi, beforeEach } from "vitest";
|
||||
import { render, screen, waitFor } from "@testing-library/react";
|
||||
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
|
||||
const mockQuickCreateIssue = vi.hoisted(() => vi.fn());
|
||||
@@ -374,17 +374,18 @@ describe("AgentCreatePanel", () => {
|
||||
'Tell the agent what to do, e.g. "let Bohan fix the inbox loading slowness in the Web project"',
|
||||
);
|
||||
await user.clear(editor);
|
||||
await user.type(
|
||||
editor,
|
||||
"Create issue with !(/api/attachments/019ec09d-6222-722b-bdfa-427b105d80be/download)",
|
||||
);
|
||||
fireEvent.change(editor, {
|
||||
target: {
|
||||
value: "Create issue with ",
|
||||
},
|
||||
});
|
||||
|
||||
await user.click(screen.getByRole("button", { name: /^Create \(/i }));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(mockQuickCreateIssue).toHaveBeenCalledWith({
|
||||
agent_id: "agent-1",
|
||||
prompt: "Create issue with !(/api/attachments/019ec09d-6222-722b-bdfa-427b105d80be/download)",
|
||||
prompt: "Create issue with ",
|
||||
project_id: undefined,
|
||||
parent_issue_id: undefined,
|
||||
attachment_ids: ["019ec09d-6222-722b-bdfa-427b105d80be"],
|
||||
|
||||
Reference in New Issue
Block a user