Audit tests

From trycompai/comp · View interactive version

Audit tests is an AI agent skill from the GitHub repository trycompai/comp. Audit & fix unit tests for permission-gated components

How to use this skill

Skill file

Check that unit tests exist and pass for permission-gated components. Write missing tests immediately.

Infrastructure

Required Test Pattern

Every component importing usePermissions MUST have tests covering:

  1. Admin (write) user: mutation elements visible/enabled
  2. Auditor (read-only): mutation elements hidden/disabled
  3. Data always visible: read-only content renders regardless of permissions

Use setMockPermissions, ADMIN_PERMISSIONS, AUDITOR_PERMISSIONS from test utils.

Process

  1. Find components with usePermissions in $ARGUMENTS
  2. Check for corresponding .test.tsx files
  3. Write missing tests following the pattern above
  4. Fix any failing tests
  5. Run: cd apps/app && bunx vitest run
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.