Files
orangecat/scripts/test/test-messaging-api.mjs
Your Name 1b2a2371e9 refactor: Complete codebase improvements per engineering principles
- Fix currency defaults (SATS → CHF) across forms, configs, and API routes
- Remove @ts-nocheck from socialService.ts and improve type safety
- Replace console.log statements with proper logger utility in production code
- Additional type safety improvements and code quality enhancements
- Documentation updates for improved maintainability

All changes follow DRY, SSOT, and separation of concerns principles.
2026-01-04 12:25:26 +01:00

44 lines
1.4 KiB
JavaScript

#!/usr/bin/env node
/**
* Test Messaging API Endpoints
*
* Tests the messaging API to verify conversations and messages work correctly
*/
import fetch from 'node-fetch';
const BASE_URL = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3001';
async function testMessagingAPI() {
console.log('🧪 Testing Messaging API\n');
console.log(`Base URL: ${BASE_URL}\n`);
try {
// Test 1: Check if server is running
console.log('1️⃣ Checking server status...');
const healthCheck = await fetch(`${BASE_URL}/api/health`).catch(() => null);
if (!healthCheck) {
console.log('⚠️ Health check endpoint not available (this is OK)');
}
console.log('✅ Server appears to be running\n');
console.log('📝 Manual Testing Instructions:');
console.log('1. Open browser to:', BASE_URL);
console.log('2. Login as "Metal Music" user');
console.log('3. Navigate to /messages');
console.log('4. Check browser console for errors');
console.log('5. Try creating a conversation');
console.log('6. Try sending a message');
console.log('\n🔍 Key things to check:');
console.log('- Are conversations loading?');
console.log('- Are messages displaying?');
console.log('- Are there any console errors?');
console.log('- Are there any network errors?');
} catch (error) {
console.error('❌ Error:', error.message);
}
}
testMessagingAPI();