-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathmessage-identity-types.test.ts
More file actions
33 lines (31 loc) · 1.23 KB
/
Copy pathmessage-identity-types.test.ts
File metadata and controls
33 lines (31 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { describe, expect, it } from "vitest";
import type { QueuePendingItems } from "../src/generated/rpc.js";
import type { UserMessageData } from "../src/generated/session-events.js";
describe("generated message identity types", () => {
it("exposes optional camelCase message IDs", () => {
const queueItemWithIdentity: QueuePendingItems = {
id: "queue-1",
messageId: "message-1",
kind: "message",
displayText: "hello",
agentMode: "interactive",
};
const queueItemFromOlderRuntime: QueuePendingItems = {
id: "queue-2",
kind: "command",
displayText: "/help",
agentMode: "interactive",
};
const userMessageWithIdentity: UserMessageData = {
content: "hello",
messageId: "message-1",
};
const userMessageFromOlderRuntime: UserMessageData = {
content: "hello",
};
expect(queueItemWithIdentity.messageId).toBe("message-1");
expect(queueItemFromOlderRuntime.messageId).toBeUndefined();
expect(userMessageWithIdentity.messageId).toBe("message-1");
expect(userMessageFromOlderRuntime.messageId).toBeUndefined();
});
});