bikidsx/comp / .agents/skills/audit-tests
audit-tests
VerifiedAudit & fix unit tests for permission-gated components
Check that unit tests exist and pass for permission-gated components. Write missing tests immediately.
Infrastructure
- Framework: Vitest with jsdom
- Component testing:
@testing-library/react+@testing-library/jest-dom - Setup:
apps/app/src/test-utils/setup.ts - Permission mocks:
apps/app/src/test-utils/mocks/permissions.ts - Run:
cd apps/app && bunx vitest run
Required Test Pattern
Every component importing usePermissions MUST have tests covering:
- Admin (write) user: mutation elements visible/enabled
- Auditor (read-only): mutation elements hidden/disabled
- Data always visible: read-only content renders regardless of permissions
Use setMockPermissions, ADMIN_PERMISSIONS, AUDITOR_PERMISSIONS from test utils.
Process
- Find components with
usePermissionsin$ARGUMENTS - Check for corresponding
.test.tsxfiles - Write missing tests following the pattern above
- Fix any failing tests
- Run:
cd apps/app && bunx vitest run
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 466k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 466k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 466k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |