const fetch = require('node-fetch');

async function testLiveTrackingAPI() {
  try {
    // First, let's test the endpoint without authentication (should fail)
    console.log('Testing live tracking API...');
    
    const response = await fetch('http://localhost:3002/api/school/live-tracking', {
      method: 'GET',
      headers: {
        'Content-Type': 'application/json'
      }
    });
    
    console.log('Response status:', response.status);
    const data = await response.text();
    console.log('Response:', data);
    
    // Test with a mock token (this will also fail but shows the endpoint exists)
    const responseWithToken = await fetch('http://localhost:3002/api/school/live-tracking', {
      method: 'GET',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer mock-token'
      }
    });
    
    console.log('Response with token status:', responseWithToken.status);
    const dataWithToken = await responseWithToken.text();
    console.log('Response with token:', dataWithToken);
    
  } catch (error) {
    console.error('Error testing API:', error);
  }
}

testLiveTrackingAPI();