The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { describe, expect, it } from "@effect/vitest"; |
| 2 | |
| 3 | import { projectThreadContentPresentation } from "./threadContentPresentation"; |
| 4 | |
| 5 | describe("thread content presentation", () => { |
| 6 | it("renders cached detail while its environment reconnects", () => { |
| 7 | expect( |
| 8 | projectThreadContentPresentation({ |
| 9 | hasDetail: true, |
| 10 | detailError: null, |
| 11 | detailDeleted: false, |
| 12 | connectionState: "reconnecting", |
| 13 | }), |
| 14 | ).toEqual({ kind: "ready" }); |
| 15 | }); |
| 16 | |
| 17 | it("explains uncached detail while disconnected instead of loading forever", () => { |
| 18 | expect( |
| 19 | projectThreadContentPresentation({ |
| 20 | hasDetail: false, |
| 21 | detailError: null, |
| 22 | detailDeleted: false, |
| 23 | connectionState: "error", |
| 24 | }), |
| 25 | ).toEqual({ |
| 26 | kind: "unavailable", |
| 27 | title: "Messages not cached", |
| 28 | detail: "Reconnect this environment to load the conversation.", |
| 29 | }); |
| 30 | }); |
| 31 | }); |