All checks were successful
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Successful in 44s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 14s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Successful in 1m18s
- Implemented `_build_evaluate_empty_slot_gap_specs` function to generate gap offer specifications for unfilled roadmap slots in evaluate-only mode. - Enhanced `ProgressionFindingsPanel` to display AI offers for empty slots and gaps, improving user interaction and clarity. - Updated `ProgressionGraphEditor` and `ProgressionSlotCard` components to support new functionalities for managing slots and offers. - Refactored utility functions in `progressionGraphDraft.js` to streamline slot management and offer handling. - Incremented application version to reflect these updates.
60 lines
1.8 KiB
Python
60 lines
1.8 KiB
Python
"""Tests Planungs-Artefakt am Progressionsgraph."""
|
|
import pytest
|
|
|
|
from progression_graph_planning_artifact import (
|
|
ARTIFACT_SCHEMA_VERSION,
|
|
normalize_planning_roadmap_payload,
|
|
)
|
|
|
|
|
|
def test_normalize_planning_roadmap_minimal():
|
|
out = normalize_planning_roadmap_payload(
|
|
{
|
|
"schema_version": ARTIFACT_SCHEMA_VERSION,
|
|
"goal_query": "Mae Geri Perfektion",
|
|
"max_steps": 5,
|
|
}
|
|
)
|
|
assert out["goal_query"] == "Mae Geri Perfektion"
|
|
assert out["max_steps"] == 5
|
|
|
|
|
|
def test_normalize_planning_roadmap_with_progression_roadmap():
|
|
out = normalize_planning_roadmap_payload(
|
|
{
|
|
"goal_query": "Kumite Beinarbeit",
|
|
"progression_roadmap": {
|
|
"stage_specs": [{"major_step_index": 0, "learning_goal": "Grundstellung"}],
|
|
},
|
|
}
|
|
)
|
|
assert out["progression_roadmap"]["stage_specs"][0]["learning_goal"] == "Grundstellung"
|
|
|
|
|
|
def test_normalize_rejects_invalid_type():
|
|
with pytest.raises(ValueError, match="JSON-Objekt"):
|
|
normalize_planning_roadmap_payload("not-json")
|
|
|
|
|
|
def test_normalize_slot_contents():
|
|
out = normalize_planning_roadmap_payload(
|
|
{
|
|
"goal_query": "Gerade-Tritt",
|
|
"max_steps": 3,
|
|
"slot_contents": [
|
|
{
|
|
"major_step_index": 0,
|
|
"primary": {"kind": "library", "exercise_id": 12, "title": "Grundstellung"},
|
|
"siblings": [],
|
|
},
|
|
{
|
|
"major_step_index": 1,
|
|
"primary": {"kind": "proposal", "title": "KI-Entwurf", "proposal_key": "p1"},
|
|
"siblings": [],
|
|
},
|
|
],
|
|
}
|
|
)
|
|
assert len(out["slot_contents"]) == 2
|
|
assert out["slot_contents"][1]["primary"]["kind"] == "proposal"
|