refactor: drop legacy room chatType
This commit is contained in:
@@ -3,17 +3,10 @@ import { describe, expect, it } from "vitest";
|
||||
import { normalizeMediaUnderstandingChatType, resolveMediaUnderstandingScope } from "./scope.js";
|
||||
|
||||
describe("media understanding scope", () => {
|
||||
it("normalizes channel/room", () => {
|
||||
it("normalizes chatType", () => {
|
||||
expect(normalizeMediaUnderstandingChatType("channel")).toBe("channel");
|
||||
expect(normalizeMediaUnderstandingChatType("room")).toBe("channel");
|
||||
});
|
||||
|
||||
it("treats room match as channel", () => {
|
||||
const scope = {
|
||||
rules: [{ action: "deny", match: { chatType: "room" } }],
|
||||
} as const;
|
||||
|
||||
expect(resolveMediaUnderstandingScope({ scope, chatType: "channel" })).toBe("deny");
|
||||
expect(normalizeMediaUnderstandingChatType("dm")).toBe("direct");
|
||||
expect(normalizeMediaUnderstandingChatType("room")).toBeUndefined();
|
||||
});
|
||||
|
||||
it("matches channel chatType explicitly", () => {
|
||||
@@ -24,4 +17,3 @@ describe("media understanding scope", () => {
|
||||
expect(resolveMediaUnderstandingScope({ scope, chatType: "channel" })).toBe("deny");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user