test: cover discord config + slug routing

This commit is contained in:
Peter Steinberger committed 2026-01-02 11:19:10 +01:00
1 parent eb44ae76f1
commit 4267a1b87d
4 files changed
+230 -9

No files matched your search

+13
View File
@@ -4,6 +4,7 @@ import path from "node:path";
import { describe, expect, it } from "vitest";
import {
buildGroupDisplayName,
deriveSessionKey,
loadSessionStore,
resolveSessionKey,
@@ -51,6 +52,18 @@ describe("sessions", () => {
).toBe("discord:group:12345");
});
it("builds discord display name with guild+channel slugs", () => {
expect(
buildGroupDisplayName({
surface: "discord",
room: "#general",
space: "friends-of-clawd",
id: "123",
key: "discord:group:123",
}),
).toBe("discord:friends-of-clawd#general");
});
it("collapses direct chats to main by default", () => {
expect(resolveSessionKey("per-sender", { From: "+1555" })).toBe("main");
});