feat(I): I-ONB — onboarding backend (setup wizard status, guide, progress tracking), 46 tests passing
This commit is contained in:
@@ -514,3 +514,47 @@ class TestDSGVOExport:
|
||||
fields = _get_sensitive_fields()
|
||||
assert isinstance(fields, dict)
|
||||
assert len(fields) > 0
|
||||
|
||||
|
||||
# ─── I-ONB: Onboarding ──────────────────────────────────────────────────────
|
||||
|
||||
|
||||
class TestOnboarding:
|
||||
"""Test the onboarding module (I-ONB)."""
|
||||
|
||||
def test_onboarding_functions_importable(self):
|
||||
"""All onboarding functions are importable."""
|
||||
from app.ai.onboarding import get_onboarding_status, get_onboarding_guide
|
||||
assert callable(get_onboarding_status)
|
||||
assert callable(get_onboarding_guide)
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_onboarding_status_returns_dict(self):
|
||||
"""get_onboarding_status returns a dict with steps and progress."""
|
||||
from app.ai.onboarding import get_onboarding_status
|
||||
|
||||
mock_db = AsyncMock()
|
||||
mock_db.scalar = AsyncMock(return_value=0)
|
||||
|
||||
result = await get_onboarding_status(mock_db, uuid.uuid4(), uuid.uuid4())
|
||||
assert isinstance(result, dict)
|
||||
assert "steps" in result
|
||||
assert "progress_pct" in result
|
||||
assert "welcome" in result["steps"]
|
||||
assert "create_agent" in result["steps"]
|
||||
assert result["steps"]["welcome"]["completed"] is True
|
||||
|
||||
def test_get_onboarding_guide_returns_steps(self):
|
||||
"""get_onboarding_guide returns a list of steps."""
|
||||
from app.ai.onboarding import get_onboarding_guide
|
||||
|
||||
result = get_onboarding_guide()
|
||||
assert isinstance(result, dict)
|
||||
assert "steps" in result
|
||||
assert len(result["steps"]) == 5
|
||||
step_ids = [s["id"] for s in result["steps"]]
|
||||
assert "welcome" in step_ids
|
||||
assert "create_agent" in step_ids
|
||||
assert "create_workflow" in step_ids
|
||||
assert "enable_knowledge" in step_ids
|
||||
assert "enable_workstream" in step_ids
|
||||
|
||||
Reference in New Issue
Block a user