17 lines
671 B
TypeScript
17 lines
671 B
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
import { resolve } from "node:path";
|
|
|
|
const route = readFileSync(resolve("src/app/api/admin/usage/aggregate/route.ts"), "utf8");
|
|
|
|
test("admin usage aggregate is a read-only 30-day billing report", () => {
|
|
assert.match(route, /requirePermission\("billing\.orders\.read"\)/);
|
|
assert.match(route, /interval '30 days'/);
|
|
assert.match(route, /percentile_cont\(0\.50\)/);
|
|
assert.match(route, /percentile_cont\(0\.95\)/);
|
|
assert.match(route, /hasData/);
|
|
assert.match(route, /report\.full/);
|
|
assert.doesNotMatch(route, /export async function POST/);
|
|
});
|