mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
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:
@@ -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");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user