import { describe, it, expect } from "vitest";
import { lookupHiya, lookupTruecaller, lookupInternalDB, checkReputation } from "./reputation.api";

describe("lookupHiya", () => {
  it("returns default result", async () => {
    const result = await lookupHiya("+1234567890");
    expect(result).not.toBeNull();
    expect(result!.source).toBe("hiya");
  });
});

describe("lookupTruecaller", () => {
  it("returns default result", async () => {
    const result = await lookupTruecaller("+1234567890");
    expect(result).not.toBeNull();
    expect(result!.source).toBe("truecaller");
  });
});

describe("lookupInternalDB", () => {
  it("returns null for uncached numbers", async () => {
    const result = await lookupInternalDB("+1234567890");
    expect(result).toBeNull();
  });
});

describe("checkReputation", () => {
  it("returns null when all APIs return low confidence", async () => {
    const result = await checkReputation("+1234567890");
    expect(result).toBeNull();
  });
});
