(partial: Partial<MessageSummary>)
| 8 | } |
| 9 | |
| 10 | function msg(partial: Partial<MessageSummary>): MessageSummary { |
| 11 | return { |
| 12 | message_id: "msg_" + Math.random().toString(36).slice(2, 8), |
| 13 | direction: "inbound", |
| 14 | from: "sender@example.com", |
| 15 | to: ["agent@example.com"], |
| 16 | recipient: "agent@example.com", |
| 17 | subject: "subject", |
| 18 | status: "read", |
| 19 | created_at: new Date().toISOString(), |
| 20 | ...partial, |
| 21 | }; |
| 22 | } |
| 23 | |
| 24 | describe("groupIntoThreads", () => { |
| 25 | const NOW = new Date("2026-05-24T12:00:00Z"); |