
Write Frontend Tests
Plan and write integration tests for changed frontend pages and components.
Install
npx skills add Significant-Gravitas/AutoGPT --skill write-frontend-tests -g -a claude-code -y- Repository
- Significant-Gravitas/AutoGPT188k
- Category
- Testing
- Updated
- 3d ago
- License
- See repository
- Context cost
- Mediumabout 1,740 tokens
- Runs scripts
- No, instructions only
What it does
Analyze the current branch diff against dev, plan integration tests for changed frontend pages/components, and write them. TRIGGER when user asks to write frontend tests, add test coverage, or 'write tests for my changes'.
Write Frontend Tests
Analyze the current branch's frontend changes, plan integration tests, and write them.
References
Before writing any tests, read the testing rules and conventions:
autogpt_platform/frontend/TESTING.md, testing strategy, file locations, examplesautogpt_platform/frontend/src/tests/AGENTS.md, detailed testing rules, MSW patterns, decision flowchartautogpt_platform/frontend/src/tests/integrations/test-utils.tsx, custom render with providersautogpt_platform/frontend/src/tests/integrations/vitest.setup.tsx, MSW server setup
Step 1: Identify changed frontend files
BASE_BRANCH="${ARGUMENTS:-dev}"
cd autogpt_platform/frontend
# Get changed frontend files (excluding generated, config, and test files)
git diff "$BASE_BRANCH"...HEAD --name-only -- src/ \
| grep -v '__generated__' \
| grep -v '__tests__' \
| grep -v '\.test\.' \
| grep -v '\.stories\.' \
| grep -v '\.spec\.'
Also read the diff to understand what changed:
git diff "$BASE_BRANCH"...HEAD --stat -- src/
git diff "$BASE_BRANCH"...HEAD -- src/ | head -500
Step 2: Categorize changes and find test targets
For each changed file, determine:
- Is it a page? (
page.tsx), these are the primary test targets - Is it a hook? (
use*.ts), test via the page/component that uses it; avoid directrenderHook()tests unless it is a shared reusable hook with standalone business logic - Is it a component? (
.tsxincomponents/), test via the parent page unless it's complex enough to warrant isolation - Is it a helper? (
helpers.ts,utils.ts), unit test directly if pure logic
Priority order:
- Pages with new/changed data fetching or user interactions
- Components with complex internal logic (modals, forms, wizards)
- Shared hooks with standalone business logic when UI-level coverage is impractical
- Pure helper functions
Skip: styling-only changes, type-only changes, config changes.


