| name | validation-testing |
| description | Pre-deployment validation, content verification, and testing strategies for CJS2026 given the current lack of automated tests |
Validation & Testing
When to Activate
Use this skill when the agent needs to:
- Validate changes before deployment
- Verify content generation succeeded
- Check for common failure patterns
- Understand why deployments fail
- Add validation to the pipeline
Current Testing Status
Critical context: CJS2026 has NO automated tests. Playwright is installed but unused.
This creates validation requirements:
- Manual verification of critical paths
- Content file validation before deploy
- Build output verification
- Runtime error monitoring via admin panel
Pre-Deployment Validation Checklist
1. Content File Validation
npm run generate-all
ls -la src/content/
2. Content Integrity Checks
timeline.length === 10
stats.length === 4
sections.details
sections.footer
sections.expect
3. Build Verification
npm run build
ls dist/
4. Environment Verification
Required environment variables:
VITE_FIREBASE_API_KEY
VITE_FIREBASE_AUTH_DOMAIN
VITE_FIREBASE_PROJECT_ID
VITE_FIREBASE_STORAGE_BUCKET
VITE_FIREBASE_MESSAGING_SENDER_ID
VITE_FIREBASE_APP_ID
For content generation:
Common Failure Patterns
Pattern 1: Empty Content Arrays
Symptom: Site shows missing content, blank sections
Cause: Airtable API failed or returned empty
Check: timeline.length and stats.length in siteContent.js
Fix: Re-run npm run generate-content with valid API key
Pattern 2: Build Succeeds with Bad Content
Symptom: Deploy completes but site is broken
Cause: Content validation missing from pipeline
Check: Review generated content files before deploy
Fix: Add content validation step to deploy workflow
Pattern 3: Firebase Function Errors
Symptom: Admin actions fail, webhooks don't process
Cause: Missing secrets, timeout, or code errors
Check: Admin panel → Errors tab
Fix: Check Cloud Function logs, verify secrets set
Pattern 4: Auth Issues
Symptom: Users can't sign in or profile not saving
Cause: Missing Firestore document, rules mismatch
Check: Firestore Console → users collection
Fix: Ensure ensureUserDocumentExists() called before updates
Manual Testing Checklist
Critical Paths
Content Verification
Adding Validation
To Deploy Workflow
- name: Validate content
run: |
node -e "
const {timeline, stats} = require('./src/content/siteContent.js');
if (timeline.length !== 10) process.exit(1);
if (stats.length !== 4) process.exit(1);
console.log('Content validation passed');
"
To Package.json
{
"scripts": {
"validate": "node scripts/validate-content.cjs",
"predeploy": "npm run validate && npm run build"
}
}
Integration Points
- cms-content-pipeline - For understanding content generation
- firebase-patterns - For runtime error monitoring
Guidelines
- Always run
npm run generate-all before deployment
- Check admin panel Errors tab after major deploys
- Verify environment variables are set in CI/CD
- Test auth flow after any AuthContext changes
- Validate content file sizes (empty = something broke)