| ... | ... | @@ -11,12 +11,7 @@ import { |
| 11 | 11 | } from "@t3tools/contracts"; |
| 12 | 12 | import * as Effect from "effect/Effect"; |
| 13 | 13 | |
| 14 | | import { |
| 15 | | findThreadById, |
| 16 | | listThreadsByProjectId, |
| 17 | | requireThread, |
| 18 | | requireThreadAbsent, |
| 19 | | } from "./commandInvariants.ts"; |
| 14 | import { listThreadsByProjectId, requireThread, requireThreadAbsent } from "./commandInvariants.ts"; |
| 20 | 15 | |
| 21 | 16 | const now = "2026-01-01T00:00:00.000Z"; |
| 22 | 17 | |
| ... | ... | @@ -121,9 +116,7 @@ const messageSendCommand: OrchestrationCommand = { |
| 121 | 116 | }; |
| 122 | 117 | |
| 123 | 118 | describe("commandInvariants", () => { |
| 124 | | it("finds threads by id and project", () => { |
| 125 | | expect(findThreadById(readModel, ThreadId.make("thread-1"))?.projectId).toBe("project-a"); |
| 126 | | expect(findThreadById(readModel, ThreadId.make("missing"))).toBeUndefined(); |
| 119 | it("lists threads by project", () => { |
| 127 | 120 | expect( |
| 128 | 121 | listThreadsByProjectId(readModel, ProjectId.make("project-b")).map((thread) => thread.id), |
| 129 | 122 | ).toEqual([ThreadId.make("thread-2")]); |