The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { afterEach, describe, expect, it } from "vite-plus/test"; |
| 2 | |
| 3 | import { appAtomRegistry } from "./atom-registry"; |
| 4 | import { |
| 5 | clearThreadComposerErrorsForEnvironment, |
| 6 | setThreadComposerError, |
| 7 | threadComposerErrorsAtom, |
| 8 | } from "./thread-composer-error"; |
| 9 | |
| 10 | afterEach(() => { |
| 11 | appAtomRegistry.set(threadComposerErrorsAtom, {}); |
| 12 | }); |
| 13 | |
| 14 | describe("thread composer errors", () => { |
| 15 | it("clears every thread's error for a removed environment and no others", () => { |
| 16 | setThreadComposerError("environment-1:thread-1", "one"); |
| 17 | setThreadComposerError("environment-1:thread-2", "two"); |
| 18 | setThreadComposerError("environment-10:thread-1", "other environment"); |
| 19 | |
| 20 | clearThreadComposerErrorsForEnvironment("environment-1"); |
| 21 | |
| 22 | expect(Object.keys(appAtomRegistry.get(threadComposerErrorsAtom))).toEqual([ |
| 23 | "environment-10:thread-1", |
| 24 | ]); |
| 25 | }); |
| 26 | }); |