"""Tests verifying domain enums are canonical and properly re-exported."""

import sys
import os

backend_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if backend_dir not in sys.path:
    sys.path.insert(0, backend_dir)

from app.domain.enums import TechniqueStatus, TestState, TeamSide, TestResult


def test_technique_status_values():
    assert TechniqueStatus.not_evaluated == "not_evaluated"
    assert TechniqueStatus.validated == "validated"
    assert TechniqueStatus.partial == "partial"
    assert TechniqueStatus.in_progress == "in_progress"
    assert TechniqueStatus.not_covered == "not_covered"
    assert TechniqueStatus.review_required == "review_required"


def test_test_state_values():
    assert TestState.draft == "draft"
    assert TestState.red_executing == "red_executing"
    assert TestState.blue_evaluating == "blue_evaluating"
    assert TestState.in_review == "in_review"
    assert TestState.validated == "validated"
    assert TestState.rejected == "rejected"


def test_team_side_values():
    assert TeamSide.red == "red"
    assert TeamSide.blue == "blue"


def test_test_result_values():
    assert TestResult.detected == "detected"
    assert TestResult.not_detected == "not_detected"
    assert TestResult.partially_detected == "partially_detected"


def test_models_enums_reexport_is_same_class():
    """Verify models/enums.py re-exports the exact same class objects."""
    from app.models.enums import (
        TechniqueStatus as MS,
        TestState as MTS,
        TeamSide as MTeam,
        TestResult as MTR,
    )
    assert MS is TechniqueStatus
    assert MTS is TestState
    assert MTeam is TeamSide
    assert MTR is TestResult
