Monorepo for Aesthetic.Computer
aesthetic.computer
1#!/usr/bin/env fish
2# Test Chat Integration, 25.11.28
3# CLI test script for chat functionality
4
5set HOST localhost:8889
6
7echo "🧪 Chat Integration Tests"
8echo "========================="
9echo ""
10
11# Test 1: HTTP health check (main session server)
12echo "📍 Test 1: Session Server Health"
13set response (curl -sk https://$HOST/ 2>&1)
14if string match -q "*session-server*" $response
15 echo " ✅ Session server responding"
16else
17 echo " ⚠️ Response: $response"
18end
19echo ""
20
21# Test 2: Chat status endpoint
22echo "📍 Test 2: Chat Status Endpoint"
23set response (curl -sk https://$HOST/chat/status 2>&1)
24if string match -q "*chat-system*" $response
25 echo " ✅ Chat status endpoint working"
26 echo " 📊 $response"
27else
28 echo " ⚠️ Response: $response"
29end
30echo ""
31
32# Test 3: WebSocket connection (requires websocat or similar)
33echo "📍 Test 3: WebSocket Connection"
34if command -v websocat > /dev/null
35 set ws_response (echo '{"type":"ping"}' | timeout 2 websocat -1 --insecure wss://$HOST/ 2>&1)
36 if test $status -eq 0
37 echo " ✅ WebSocket connection successful"
38 else
39 echo " ⚠️ WebSocket test requires chat host header"
40 end
41else
42 echo " ⏭️ Skipped (websocat not installed)"
43end
44echo ""
45
46# Test 4: Log endpoint (requires auth)
47echo "📍 Test 4: Log Endpoint (Auth Required)"
48set response (curl -sk -X POST https://$HOST/chat/log \
49 -H "Authorization: Bearer invalid" \
50 -H "Content-Type: application/json" \
51 -d '{"text":"Test message"}' 2>&1)
52if string match -q "*Forbidden*" $response
53 echo " ✅ Auth check working (correctly rejected invalid token)"
54else
55 echo " ⚠️ Response: $response"
56end
57echo ""
58
59echo "========================="
60echo "🏁 Tests complete!"
61echo ""
62echo "For full WebSocket testing, connect to:"
63echo " wss://chat-system.aesthetic.computer"
64echo " wss://chat-clock.aesthetic.computer"
65echo " wss://chat.sotce.net"