---
description: Run local tests before pushing to Git
---

# Local Testing

Run tests BEFORE pushing to Git to avoid broken releases.

## Quick Test (JavaScript only)
```bash
cd ~/Desktop/projects/idevelop-floating-circle-button
npm test
```

## Full Test (PHP + JavaScript + Docker)
```bash
cd ~/Desktop/projects/idevelop-floating-circle-button
./test-local.sh --full
```

## What Each Test Checks

### `npm test` (Fast - 5 seconds)
- ✅ JavaScript functionality on mock HTML
- ✅ Hub toggle animation
- ✅ WhatsApp URL generation
- ❌ Does NOT test PHP code

### `./test-local.sh` (Medium - 30 seconds)
- ✅ PHP syntax validation (all files)
- ✅ JavaScript mock tests
- ❌ Does NOT test in real WordPress

### `./test-local.sh --full` (Complete - 2 minutes)
- ✅ PHP syntax validation
- ✅ JavaScript mock tests
- ✅ Docker WordPress environment
- ✅ Admin settings page
- ✅ Frontend button rendering

## Before Pushing Checklist

1. [ ] Run `./test-local.sh`
2. [ ] Check version numbers match in:
   - `idevelop-floating-circle-button.php` (line 5)
   - `readme.txt` (line 5 and 12)
3. [ ] Update changelog in `readme.txt`
4. [ ] Push to Git

## First-Time Setup
```bash
# Install Playwright
npm install
npx playwright install chromium

# Make test script executable
chmod +x test-local.sh
```
