import { resolveRequestUrl } from "@/lib/api";

describe("resolveRequestUrl", () => {
  it("does not prepend baseURL to an absolute request URL", () => {
    expect(
      resolveRequestUrl({
        baseURL: "http://localhost:8000",
        url: "http://localhost:8000/api/v1/schemes",
      }),
    ).toBe("http://localhost:8000/api/v1/schemes");
  });

  it("combines baseURL with a relative request URL", () => {
    expect(
      resolveRequestUrl({
        baseURL: "http://localhost:8000",
        url: "/api/v1/schemes",
      }),
    ).toBe("http://localhost:8000/api/v1/schemes");
  });
});
