Skip to main content

audit-tests

Audit & fix unit tests for permission-gated components

소스 정보

저장소
trycompai/comp
최근 소스 활동
2026년 4월 27일 13:56
감지된 SKILL.md 언어
영어
스타
2,074
포크
441

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
audit-tests
description
Audit & 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: 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`
GitHub에서 보기