import { describe, expect, it } from "vitest";
import { isGoogleChatSenderSelf } from "./monitor.js";

describe("isGoogleChatSenderSelf", () => {
  it("always treats the Chat app identity as self-authored", () => {
    expect(isGoogleChatSenderSelf({ name: "users/app", type: "BOT" })).toBe(true);
  });

  it("recognizes configured bot user identity", () => {
    expect(isGoogleChatSenderSelf({ name: "users/123", type: "BOT" }, "users/123")).toBe(true);
    expect(isGoogleChatSenderSelf({ name: "users/456", type: "BOT" }, "users/123")).toBe(false);
  });
});
