Files
hackerspace.sh/__tests__
Moheeb ZaraandClaude Opus 4.8 d18d6acaff test: replace tautological actions.test with real authz/IDOR tests
The old file asserted on string literals it defined itself (e.g.
expect(".eq('space_id', ...)").toContain('space_id')) and never invoked an
action, so it stayed green regardless of the code — false confidence on exactly
the authz/scoping it claimed to cover.

Rewrite drives the real updateMember/removeMember/logCashPayment through a
recording mock Supabase client and asserts: unauthenticated + non-privileged
callers are rejected with no write; admin/treasurer writes are pinned to the
caller's own space_id (the IDOR guard). Removing a role gate or a space_id
scope now fails a test.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-01 21:23:04 -07:00
..