Summary
Introduce a real frontend test suite for the most important member, admin, wallet, and gated access flows.
Current Behaviour
The project has lint and typecheck scripts, but no visible test script or test framework. Behaviour such as mock/live API switching, admin guards, access denial, and role assignment is not protected by automated tests.
Expected Behaviour
Core UI and API integration behaviour should be covered by deterministic tests that run in CI and local development.
Suggested Implementation
Add Vitest with React Testing Library for component and hook-level tests. Add mock providers for wagmi and React Query. Cover mock API behaviour, Gated, AdminGuard, admin member role assignment, and policy updates.
Files or Areas Likely Affected
package.json
vitest.config.ts
test/
components/gated.tsx
components/admin-guard.tsx
app/admin/members/page.tsx
app/admin/policies/page.tsx
lib/api/
Acceptance Criteria
Additional Notes
Keep tests independent from browser wallet extensions and external blockchain RPC endpoints.
Summary
Introduce a real frontend test suite for the most important member, admin, wallet, and gated access flows.
Current Behaviour
The project has lint and typecheck scripts, but no visible test script or test framework. Behaviour such as mock/live API switching, admin guards, access denial, and role assignment is not protected by automated tests.
Expected Behaviour
Core UI and API integration behaviour should be covered by deterministic tests that run in CI and local development.
Suggested Implementation
Add Vitest with React Testing Library for component and hook-level tests. Add mock providers for wagmi and React Query. Cover mock API behaviour,
Gated,AdminGuard, admin member role assignment, and policy updates.Files or Areas Likely Affected
package.jsonvitest.config.tstest/components/gated.tsxcomponents/admin-guard.tsxapp/admin/members/page.tsxapp/admin/policies/page.tsxlib/api/Acceptance Criteria
npm testruns the frontend test suiteAdditional Notes
Keep tests independent from browser wallet extensions and external blockchain RPC endpoints.