Split src/http/app.test.ts into one file per concern, and reset the reading-cost trend
CI / full-gate (push) Successful in 3m20s

This commit is contained in:
2026-10-31 10:35:08 +01:00
parent 72528f01ef
commit 71b12a6c0a
16 changed files with 1510 additions and 1430 deletions
+1 -1
View File
@@ -62,4 +62,4 @@ property of a user or a group, edited as a checkbox list on those two screens (`
The three screens hold **no state** — everything lives in Ory. Handlers are thin, so their builders
unit-test as pure functions with no host; the HTTP routing/gate/CSRF is covered in
`src/http/app.test.ts` (which mounts this plugin) and end-to-end in `e2e-tests/full-flow.spec.ts`.
`src/http/app-admin.test.ts` (which mounts this plugin) and end-to-end in `e2e-tests/full-flow.spec.ts`.
+1 -1
View File
@@ -1,6 +1,6 @@
// Built-in OAuth2 clients admin screen: the pure view-model + Hydra-payload builders. A client
// is an Ory Hydra OAuth2 client (apps that log in *through* us); writes go only to Hydra. The
// HTTP routing/gate/CSRF + live Hydra calls (incl. the one-time secret) are exercised in app.test.ts.
// HTTP routing/gate/CSRF + live Hydra calls (incl. the one-time secret) are exercised in app-admin.test.ts.
import assert from "node:assert/strict";
import { test } from "node:test";
import {
+1 -1
View File
@@ -1,5 +1,5 @@
// The pure half of permission granting: what a submitted checkbox set changes, and the picker the
// two screens render from it. The Keto writes and the HTTP round trip are covered in app.test.ts.
// two screens render from it. The Keto writes and the HTTP round trip are covered in app-admin.test.ts.
import assert from "node:assert/strict";
import { test } from "node:test";
import type { PermissionDecl } from "@plainpages/plugin-api";
+1 -1
View File
@@ -1,7 +1,7 @@
// Built-in Groups admin screen: the pure view-model + Keto-tuple builders. A group is a
// Keto subject set (Group:<name>#members); membership tuples carry users (subject_id) or nested
// groups (subject_set). The HTTP routing/gate/CSRF + live Keto/Kratos calls are exercised over
// HTTP in app.test.ts.
// HTTP in app-admin.test.ts.
import assert from "node:assert/strict";
import { test } from "node:test";
import {
+1 -1
View File
@@ -1,6 +1,6 @@
// Direct units for the admin plugin's shared nav + auth helpers. They're security-critical
// (requirePermission/guardedForm gate every admin write) and reused across all three screens, so pin the
// contract here in isolation; the HTTP routing/gate/CSRF is exercised end-to-end in src/http/app.test.ts.
// contract here in isolation; the HTTP routing/gate/CSRF is exercised end-to-end in src/http/app-admin.test.ts.
// Import only from the @plainpages/plugin-api barrel — the same contract boundary the plugin code uses.
import assert from "node:assert/strict";
import type { IncomingMessage, ServerResponse } from "node:http";
+1 -1
View File
@@ -1,5 +1,5 @@
// Users admin screen (example plugin): the pure view-model + Kratos-payload builders. The HTTP
// routing/gate/CSRF + live Kratos calls are exercised over HTTP in src/http/app.test.ts.
// routing/gate/CSRF + live Kratos calls are exercised over HTTP in src/http/app-admin.test.ts.
import assert from "node:assert/strict";
import { test } from "node:test";
import type { Identity } from "@plainpages/plugin-api";