#!/usr/bin/env fish # Test Chat Integration, 25.11.28 # CLI test script for chat functionality set HOST localhost:8889 echo "๐Ÿงช Chat Integration Tests" echo "=========================" echo "" # Test 1: HTTP health check (main session server) echo "๐Ÿ“ Test 1: Session Server Health" set response (curl -sk https://$HOST/ 2>&1) if string match -q "*session-server*" $response echo " โœ… Session server responding" else echo " โš ๏ธ Response: $response" end echo "" # Test 2: Chat status endpoint echo "๐Ÿ“ Test 2: Chat Status Endpoint" set response (curl -sk https://$HOST/chat/status 2>&1) if string match -q "*chat-system*" $response echo " โœ… Chat status endpoint working" echo " ๐Ÿ“Š $response" else echo " โš ๏ธ Response: $response" end echo "" # Test 3: WebSocket connection (requires websocat or similar) echo "๐Ÿ“ Test 3: WebSocket Connection" if command -v websocat > /dev/null set ws_response (echo '{"type":"ping"}' | timeout 2 websocat -1 --insecure wss://$HOST/ 2>&1) if test $status -eq 0 echo " โœ… WebSocket connection successful" else echo " โš ๏ธ WebSocket test requires chat host header" end else echo " โญ๏ธ Skipped (websocat not installed)" end echo "" # Test 4: Log endpoint (requires auth) echo "๐Ÿ“ Test 4: Log Endpoint (Auth Required)" set response (curl -sk -X POST https://$HOST/chat/log \ -H "Authorization: Bearer invalid" \ -H "Content-Type: application/json" \ -d '{"text":"Test message"}' 2>&1) if string match -q "*Forbidden*" $response echo " โœ… Auth check working (correctly rejected invalid token)" else echo " โš ๏ธ Response: $response" end echo "" echo "=========================" echo "๐Ÿ Tests complete!" echo "" echo "For full WebSocket testing, connect to:" echo " wss://chat-system.aesthetic.computer" echo " wss://chat-clock.aesthetic.computer" echo " wss://chat.sotce.net"