Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

useThreadActions.test.ts

19 lines647 Bytes

1import { EnvironmentId, ThreadId } from "@t3tools/contracts";
2import { describe, expect, it } from "vite-plus/test";
3​
4import { ThreadArchiveBlockedError } from "./useThreadActions";
5​
6describe("ThreadArchiveBlockedError", () => {
7 it("keeps the blocked thread context with the fixed message", () => {
8 const error = new ThreadArchiveBlockedError({
9 environmentId: EnvironmentId.make("environment-1"),
10 threadId: ThreadId.make("thread-1"),
11 });
12​
13 expect(error).toMatchObject({
14 environmentId: "environment-1",
15 threadId: "thread-1",
16 });
17 expect(error.message).toBe("Cannot archive a running thread.");
18 });
19});