mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
The unit file walks the arms with the grant module deliberately unmocked, so the resolver consuming the one "is this grant active" predicate is a property under test rather than a claim in a comment. Its Prisma fake honours its own `where` clause for the same reason: a fake that answers any query with any row turns every scoping assertion into a check that cannot fail. The integration file proves the two things a unit suite cannot, because both are about which rows come back. Substitution: the owner's measurements are returned and the delegate's own, seeded alongside, are not, so a resolver that quietly served the caller their own record shows up as the wrong values rather than as an empty list. Never cached: a revocation lands between two requests inside one test and the second one 403s. The do-no-harm arm runs against a real shipped route, and the cookie-only helpers are asserted against a real session row carrying a real switch, because the one edit that would break them is `getSession()` itself substituting the owner and no mocked session can catch that. The structural guard freezes the set of files allowed to touch the carrier column and the selector header, and asserts a non-zero match count before comparing against the allowlist. A matcher that finds nothing agrees with an emptied list and reports success; this repository has shipped several guards that did exactly that.