perf(test): consolidate media-understanding misc suites

This commit is contained in:
Peter Steinberger
2026-02-15 23:47:11 +00:00
parent 5529473af9
commit 2cf060f774
2 changed files with 17 additions and 18 deletions

View File

@@ -1,5 +1,22 @@
import { afterEach, describe, expect, it, vi } from "vitest";
import { MediaAttachmentCache } from "./attachments.js";
import { normalizeMediaUnderstandingChatType, resolveMediaUnderstandingScope } from "./scope.js";
describe("media understanding scope", () => {
it("normalizes chatType", () => {
expect(normalizeMediaUnderstandingChatType("channel")).toBe("channel");
expect(normalizeMediaUnderstandingChatType("dm")).toBe("direct");
expect(normalizeMediaUnderstandingChatType("room")).toBeUndefined();
});
it("matches channel chatType explicitly", () => {
const scope = {
rules: [{ action: "deny", match: { chatType: "channel" } }],
} as const;
expect(resolveMediaUnderstandingScope({ scope, chatType: "channel" })).toBe("deny");
});
});
const originalFetch = globalThis.fetch;

View File

@@ -1,18 +0,0 @@
import { describe, expect, it } from "vitest";
import { normalizeMediaUnderstandingChatType, resolveMediaUnderstandingScope } from "./scope.js";
describe("media understanding scope", () => {
it("normalizes chatType", () => {
expect(normalizeMediaUnderstandingChatType("channel")).toBe("channel");
expect(normalizeMediaUnderstandingChatType("dm")).toBe("direct");
expect(normalizeMediaUnderstandingChatType("room")).toBeUndefined();
});
it("matches channel chatType explicitly", () => {
const scope = {
rules: [{ action: "deny", match: { chatType: "channel" } }],
} as const;
expect(resolveMediaUnderstandingScope({ scope, chatType: "channel" })).toBe("deny");
});
});