test: update session key expectations for dmdirect migration

- Fix test expectations to expect :direct: in generated output
- Add explicit backward compat test for normalizeChatType('dm')
- Keep input test data with :dm: keys to verify backward compat
This commit is contained in:
quotentiroler
2026-02-08 09:49:30 -08:00
parent 6f97b9d76f
commit 4e7392cb36

View File

@@ -15,4 +15,13 @@ describe("normalizeChatType", () => {
expect(normalizeChatType("nope")).toBeUndefined();
expect(normalizeChatType("room")).toBeUndefined();
});
describe("backward compatibility", () => {
it("accepts legacy 'dm' value and normalizes to 'direct'", () => {
// Legacy config/input may use "dm" - ensure smooth upgrade path
expect(normalizeChatType("dm")).toBe("direct");
expect(normalizeChatType("DM")).toBe("direct");
expect(normalizeChatType(" dm ")).toBe("direct");
});
});
});