from __future__ import annotations

import pytest

from v1.agent.crewai_flow import AgentFlow


class TestCrewAIFlow:
    @pytest.mark.asyncio
    async def test_flow_stages_run_in_order(self):
        flow = AgentFlow()
        await flow.run()
        assert flow.state.stage_trace == ["intent", "execution", "reporting"]

    @pytest.mark.asyncio
    async def test_flow_state_initialized(self):
        flow = AgentFlow()
        assert flow.state.stage_trace == []
        assert flow.state.current_stage is None

    @pytest.mark.asyncio
    async def test_flow_updates_current_stage(self):
        flow = AgentFlow()
        await flow.run()
        assert flow.state.current_stage == "reporting"
