The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { describe, expect, it } from "vite-plus/test"; |
| 2 | |
| 3 | import { resolveComposerSendPresentation } from "./composerSendPresentation"; |
| 4 | |
| 5 | const idle = { |
| 6 | editingQueuedMessage: false, |
| 7 | running: false, |
| 8 | canSteer: false, |
| 9 | followUpBehavior: "queue", |
| 10 | deliveryDeferred: false, |
| 11 | } as const; |
| 12 | |
| 13 | describe("resolveComposerSendPresentation", () => { |
| 14 | it("shows the outbox action when delivery is deferred", () => { |
| 15 | const presentation = resolveComposerSendPresentation({ ...idle, deliveryDeferred: true }); |
| 16 | expect(presentation.label).toBe("Queue"); |
| 17 | expect(presentation.icon).toBe("tray.and.arrow.up"); |
| 18 | expect(resolveComposerSendPresentation(idle).icon).toBe("arrow.up"); |
| 19 | }); |
| 20 | |
| 21 | it("never promises steering the provider cannot do", () => { |
| 22 | const presentation = resolveComposerSendPresentation({ |
| 23 | ...idle, |
| 24 | running: true, |
| 25 | canSteer: false, |
| 26 | followUpBehavior: "steer", |
| 27 | }); |
| 28 | |
| 29 | expect(presentation.label).toBe("Queue"); |
| 30 | expect(presentation.action).toBe("queue"); |
| 31 | expect(presentation.alternate).toBeNull(); |
| 32 | expect(presentation.offersFollowUpChoice).toBe(false); |
| 33 | }); |
| 34 | }); |