import numpy as np
from explorer_helpers import inspect_positions_for_issues


def test_inspect_positions_for_issues_basic():
    positions_by_window = {
        "w1": {"mp1": (1.0, 2.0), "mp2": (float("nan"), float("nan"))},
        "w2": {},
    }
    party_map = {"mp1": "P1"}
    d = inspect_positions_for_issues(positions_by_window, party_map)

    # basic keys still present
    assert d["windows_count"] == 2
    assert isinstance(d["mp_id_set"], set)
    # new diagnostics
    assert "mp_positions_count" in d
    assert d["mp_positions_count"] >= 1
    assert "mp_positions_sample" in d
    assert isinstance(d["mp_positions_sample"], list)
    assert "windows_with_no_positions" in d
    assert isinstance(d["windows_with_no_positions"], list)
