16 lines
672 B
TypeScript
16 lines
672 B
TypeScript
import { readFile } from "node:fs/promises";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
describe("usage HTTP compatibility fixture", () => {
|
|
it("freezes personal/admin scope and filters", async () => {
|
|
const fixture = JSON.parse(await readFile("contracts/usage/http-v1.json", "utf8"));
|
|
expect(fixture).toMatchObject({
|
|
version: 1,
|
|
presets: ["today", "7d", "30d", "month"],
|
|
capabilities: ["image.generate", "video.generate"],
|
|
infrastructureStatus: 500
|
|
});
|
|
expect(fixture.routes).toContainEqual(expect.objectContaining({ path: "/api/admin/usage", requirement: "admin", organizationAdminScope: "refreshed_session" }));
|
|
});
|
|
});
|