The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { EnvironmentId } from "@t3tools/contracts"; |
| 2 | import { describe, expect, it } from "vite-plus/test"; |
| 3 | |
| 4 | import { attachmentUploadBlockReason } from "./attachmentUploadState"; |
| 5 | |
| 6 | const environmentId = EnvironmentId.make("environment-1"); |
| 7 | |
| 8 | describe("attachmentUploadBlockReason", () => { |
| 9 | it("does not accept an upload from another environment", () => { |
| 10 | expect( |
| 11 | attachmentUploadBlockReason({ |
| 12 | imageIds: ["image-1"], |
| 13 | environmentId, |
| 14 | uploadsByImageId: { |
| 15 | "image-1": { |
| 16 | status: "ready", |
| 17 | environmentId: EnvironmentId.make("environment-2"), |
| 18 | attachmentId: "pending-1", |
| 19 | }, |
| 20 | }, |
| 21 | }), |
| 22 | ).toBe("Attachment still uploading"); |
| 23 | }); |
| 24 | }); |