// src/tests/integration/system.integration.test.ts
import { describe, it, expect } from 'vitest';
import * as apiClient from '../../services/apiClient';

/**
 * @vitest-environment node
 */

describe('System API Routes Integration Tests', () => {
  describe('GET /api/system/pm2-status', () => {
    it('should return a status for PM2', async () => {
      // In a typical CI environment without PM2, this will fail gracefully.
      // The test verifies that the endpoint responds correctly, even if PM2 isn't running.
      const response = await apiClient.checkPm2Status();
      const result = await response.json();
      expect(result).toBeDefined();
      expect(result).toHaveProperty('success');
      expect(result).toHaveProperty('message');
    });
  });
});