import { describe, it, expect, beforeEach, vi } from '@jest/globals';
import { WorkflowEngineService } from '../../core/engine/WorkflowEngineService';

describe('WorkflowEngineService', () => {
  let workflowEngineService: WorkflowEngineService;

  beforeEach(() => {
    workflowEngineService = new WorkflowEngineService();
  });

  describe('executeWorkflow', () => {
    it('should execute workflow and return result', async () => {
      const workflowId = 'workflow-1';
      const data = { processed: true };

      const result = await workflowEngineService.executeWorkflow(workflowId, data);

      expect(result).toHaveProperty('success');
    });
  });

  describe('registerWorkflow', () => {
    it('should register workflow and return workflow id', async () => {
      const workflow = { id: 'workflow-1', steps: [] };

      const result = await workflowEngineService.registerWorkflow(workflow);

      expect(typeof result).toBe('string');
    });
  });

  describe('getStatus', () => {
    it('should return workflow engine status', async () => {
      const result = await workflowEngineService.getStatus();
      expect(result).toHaveProperty('status');
    });
  });
});
