import assert from "node:assert/strict";
import test from "node:test";
import { createStorageApi } from "../../lib/server/storage-api.ts";

test("returns public storage usage without object keys", async () => {
  const api = createStorageApi({ usage: async () => ({ usedBytes: 10, sourceBytes: 7, audioBytes: 3, pendingUploadBytes: 2, softLimitBytes: 100 }) });
  const response = await api.get();
  assert.equal(response.status, 200);
  assert.deepEqual(await response.json(), { storage: { usedBytes: 10, sourceBytes: 7, audioBytes: 3, pendingUploadBytes: 2, softLimitBytes: 100 } });
});
