42 lines
1.1 KiB
Bash
42 lines
1.1 KiB
Bash
#!/bin/bash
|
|
|
|
# Test API signup endpoint
|
|
|
|
echo "Testing API signup endpoint..."
|
|
echo ""
|
|
|
|
# Test 1: Check if API is reachable
|
|
echo "1. Checking if API is reachable..."
|
|
curl -s -o /dev/null -w "HTTP Status: %{http_code}\n" http://localhost:3001/health || echo "Health endpoint not found"
|
|
|
|
echo ""
|
|
|
|
# Test 2: Try signup with correct data
|
|
echo "2. Attempting signup with correct data..."
|
|
curl -X POST http://localhost:3001/auth/signup \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"email": "testuser@example.com",
|
|
"password": "TestPass123",
|
|
"displayName": "Test User"
|
|
}' \
|
|
-w "\nHTTP Status: %{http_code}\n" \
|
|
-s
|
|
|
|
echo ""
|
|
|
|
# Test 3: Try signup with extra fields (should fail with whitelist error)
|
|
echo "3. Attempting signup with extra fields (should fail)..."
|
|
curl -X POST http://localhost:3001/auth/signup \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"email": "testuser2@example.com",
|
|
"password": "TestPass123",
|
|
"displayName": "Test User 2",
|
|
"extraField": "should not exist"
|
|
}' \
|
|
-w "\nHTTP Status: %{http_code}\n" \
|
|
-s
|
|
|
|
echo ""
|
|
echo "Done." |