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

userMessageIntentBadge.test.ts

39 lines1.5 KB

1import { describe, expect, it } from "@effect/vitest";
2​
3import { resolveUserMessageIntentBadge } from "./userMessageIntentBadge";
4​
5describe("user message intent badge", () => {
6 it("does not label ordinary turn-start messages", () => {
7 expect(resolveUserMessageIntentBadge(undefined)).toBeNull();
8 expect(resolveUserMessageIntentBadge("turn_start")).toBeNull();
9 });
10​
11 it("explains the queued history without claiming delivery", () => {
12 expect(resolveUserMessageIntentBadge("queued_turn")).toEqual({
13 label: "from queue",
14 accessibilityLabel: "Queued while the agent was busy",
15 explanation:
16 "This badge records that the message was queued. It stays visible after the message leaves the queue.",
17 tone: "queued",
18 });
19 });
20​
21 it("explains the intent to steer without claiming delivery", () => {
22 expect(resolveUserMessageIntentBadge("steer")).toEqual({
23 label: "steer",
24 accessibilityLabel: "Steered the active turn",
25 explanation: "This message was intended to steer the agent while its turn was still running.",
26 tone: "steer",
27 });
28 });
29​
30 it("preserves the queued origin after promotion to steer", () => {
31 expect(resolveUserMessageIntentBadge("promoted_queued_to_steer")).toEqual({
32 label: "queued → steer",
33 accessibilityLabel: "Originally queued, then promoted to steer the active turn",
34 explanation:
35 "This message was originally queued, then promoted to steer the agent while its turn was still running.",
36 tone: "steer",
37 });
38 });
39});