import { describe, expect, it } from "vitest";
import { resolveAdminApiBaseUrl } from "./api";

describe("resolveAdminApiBaseUrl", () => {
  it("pins the deployed admin panel to the production api", () => {
    expect(resolveAdminApiBaseUrl("production", "https://api-staging.xtablo.com/api/v1")).toBe(
      "https://api.xtablo.com/api/v1"
    );
    expect(resolveAdminApiBaseUrl("production")).toBe("https://api.xtablo.com/api/v1");
  });

  it("keeps localhost for local development", () => {
    expect(resolveAdminApiBaseUrl("development")).toBe("http://localhost:8080/api/v1");
  });
});
