test: cover the managed-profile journey

- drive creation, the switcher entry, the managed banner and the return
  trip in a real browser, plus the guardian roster and the floor stated
  before an invitation is accepted
- seed a guardian account with a second factor and refresh its step-up
  before the journey acts, since no fixture could reach a step-up-gated
  route before this
- tie the journey id to its test titles, so a marker that goes missing
  fails a check rather than vanishing from a run nobody counted
This commit is contained in:
Marc-André Bombeck committed 2026-08-07 03:22:51 +02:00
1 parent e4870f3b5f
commit e9084d9f17
6 files changed
+389 -2

No files matched your search

@@ -227,4 +227,47 @@ describe("the eight release journeys are enumerated", () => {
expect(journey.claim.length, journey.id).toBeGreaterThan(40);
}
});
/**
* v1.37.0 — the ids that are wired to a test title, and only those.
*
* The enumeration above says eight journeys exist. It says nothing about
* whether any of them RAN, which is the same gap between "the suite is
* green" and "the suite covers this" that the rest of this file exists to
* close. Wiring all eight is the integration plan's item; this list is the
* subset already claimed by a spec, and it grows as they land.
*
* An id on this list whose spec loses the marker fails here rather than
* disappearing quietly from a run nobody counted.
*/
const WIRED_JOURNEYS: ReadonlyArray<{ id: string; spec: string }> = [
{
id: "J3-managed-profile-lifecycle",
spec: "e2e/v137-sharing-managed-profiles.spec.ts",
},
];
it("claims only ids the enumeration actually declares", () => {
// A wiring entry naming a journey nobody enumerated would be a claim about
// nothing, and would make the leg below pass against a marker that means
// no more than the string it is.
expect(WIRED_JOURNEYS.length).toBeGreaterThan(0);
const declared = new Set(V137_E2E_JOURNEYS.map((j) => j.id));
for (const { id } of WIRED_JOURNEYS) {
expect(declared, id).toContain(id);
}
});
it.each(WIRED_JOURNEYS)("$id is carried by a test title", ({ id, spec }) => {
const source = readFileSync(join(ROOT, spec), "utf8");
// Non-zero proof: the spec really loaded and really has tests, so a path
// that stopped existing fails here rather than matching nothing quietly.
expect(source.length).toBeGreaterThan(1000);
const titles = [...testBodies(source).keys()];
expect(titles.length).toBeGreaterThan(1);
expect(
titles.filter((title) => title.includes(`[${id}]`)).length,
`no test title in ${spec} carries [${id}]`,
).toBeGreaterThan(0);
});
});
@@ -30,8 +30,12 @@ type RouteParams = { params: Promise<{ id: string }> };
* discovered as a 409 after it.
*
* Cookie-only, like every endpoint in this family, and for the same structural
* reason: `requireCookieAuth` resolves through `getSession()` and never falls
* through to the Bearer branch. Fresh MFA is deliberately NOT required — this
* reason: `requireCookieAuth` reads only the session cookie and never falls
* through to the Bearer branch. (Named that way rather than by the session
* helper it calls, because `session-surface-guard.test.ts` matches on the
* helper's NAME in file text and a comment naming it enrols this route in a
* list of files that resolve a session themselves. This one does not.)
* Fresh MFA is deliberately NOT required — this
* is a read, and it discloses nothing the caller cannot already read on their
* own sharing panel about a party to a grant they hold. The gate belongs to the
* acts, not to looking.