import { afterEach, expect, rs, test } from "@rstest/core"; import { cleanup, fireEvent, render, screen } from "@testing-library/react"; import { PromptInputProvider, usePromptInputAttachments, } from "@/components/ai-elements/prompt-input"; import { InputAttachment } from "@/components/workspace/input-attachment"; import { I18nContext } from "@/core/i18n/context"; import { zhCN } from "@/core/i18n/locales/zh-CN"; afterEach(() => { cleanup(); rs.restoreAllMocks(); }); test("localized remove actions identify the file and preserve other attachments without submitting", () => { const revoke = rs.spyOn(URL, "revokeObjectURL"); rs.spyOn(URL, "createObjectURL").mockImplementation( (blob) => `blob:${(blob as File).name}`, ); const submit = rs.fn(); const name = "quarterly-budget-and-project-delivery-review-final.xlsx"; function Files() { const attachments = usePromptInputAttachments(); return (
); } render(