import assert from "node:assert/strict";
import test from "node:test";
import { createProApi } from "./pro-api.js";

test("Pro API uses the entitlement status, challenge, and activation contracts", async () => {
  const calls = [];
  const api = createProApi(async (path, options = {}) => { calls.push([path, options]); return { ok: true }; });
  await api.status(); await api.challenge(); await api.activate("challenge", "certificate");
  assert.deepEqual(calls, [
    ["/entitlement", {}],
    ["/entitlement/challenges", { method: "POST", body: {} }],
    ["/entitlement/activate", { method: "POST", body: { challenge: "challenge", certificate: "certificate" } }]
  ]);
});
