#!/bin/bash

echo "=== Testing Shortcode Rendering on Staging ==="
echo ""

# Test master dashboard page
echo "1. Testing Master Dashboard Page..."
response=$(curl -s https://upskill-staging.measurequick.com/master-trainer/dashboard/)
if echo "$response" | grep -q "\[hvac_master_dashboard\]"; then
    echo "❌ Master dashboard shortcode NOT rendering (raw shortcode found)"
else
    if echo "$response" | grep -q "Master Trainer Dashboard"; then
        echo "✅ Master dashboard shortcode IS rendering properly"
    else
        echo "⚠️ Master dashboard page content unclear - needs manual check"
    fi
fi

echo ""
echo "2. Testing Login Page..."
response=$(curl -s https://upskill-staging.measurequick.com/training-login/)
if echo "$response" | grep -q "\[hvac_community_login\]"; then
    echo "❌ Login shortcode NOT rendering (raw shortcode found)"
else
    if echo "$response" | grep -q "hvac-login-form"; then
        echo "✅ Login shortcode IS rendering properly"
    else
        echo "⚠️ Login page content unclear - needs manual check"
    fi
fi

echo ""
echo "3. Testing Trainer Dashboard..."
response=$(curl -s https://upskill-staging.measurequick.com/trainer/dashboard/)
if echo "$response" | grep -q "\[hvac_dashboard\]"; then
    echo "❌ Dashboard shortcode NOT rendering (raw shortcode found)"
else
    if echo "$response" | grep -q "Trainer Dashboard"; then
        echo "✅ Dashboard shortcode IS rendering properly"
    else
        echo "⚠️ Dashboard page content unclear - needs manual check"
    fi
fi

echo ""
echo "=== Shortcode Test Complete ==="