Skip to content
Source
Sign inSign up

attachmentUploadState.test.ts

24 lines726 Bytes

1import { EnvironmentId } from "@t3tools/contracts";
2import { describe, expect, it } from "vite-plus/test";
3​
4import { attachmentUploadBlockReason } from "./attachmentUploadState";
5​
6const environmentId = EnvironmentId.make("environment-1");
7​
8describe("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});