#!/bin/bash
# Quick E2E test runner with timeout protection

set -e

echo "🧪 Running quick E2E test..."

# Kill test after 45 seconds
(
  sleep 45
  pkill -f "playwright test" 2>/dev/null || true
  echo "⏱️  Test killed after 45s timeout"
) &
KILLER_PID=$!

# Run single test
pnpm exec playwright test map-planner-sync.spec.ts --project=chromium --workers=1 2>&1 | head -100

# Kill the timeout killer if test finished
kill $KILLER_PID 2>/dev/null || true

echo "✅ Test completed"
