import test from "node:test";
import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";

test("accounts api exposes transient add-login and existing account management calls", async () => {
  const api = await readFile(new URL("./accounts-api.js", import.meta.url), "utf8");

  assert.match(api, /startAccountLoginAttempt/);
  assert.match(api, /completeAccountLoginAttempt/);
  assert.match(api, /cancelAccountLoginAttempt/);
  assert.match(api, /account-login-attempts/);
  assert.match(api, /listAccounts/);
  assert.match(api, /connectAccount/);
  assert.match(api, /\/login/);
  assert.match(api, /updateAccount/);
  assert.match(api, /method: "PATCH"/);
  assert.match(api, /deleteAccount/);
});
