"""
Test to reproduce the has_image_overlays import error.
This test verifies that has_image_overlays can be imported from utils.constants.
"""

import pytest


def test_has_image_overlays_importable_from_constants():
    """Test that has_image_overlays can be imported from utils.constants"""
    try:
        from src.utils.constants import has_image_overlays
        assert callable(has_image_overlays), "has_image_overlays should be a callable function"
    except ImportError as e:
        pytest.fail(f"Failed to import has_image_overlays from utils.constants: {e}")


def test_has_image_overlays_returns_boolean():
    """Test that has_image_overlays returns a boolean value"""
    from src.utils.constants import has_image_overlays
    result = has_image_overlays()
    assert isinstance(result, bool), f"has_image_overlays() should return bool, got {type(result)}"


def test_panels_can_import_has_image_overlays():
    """Test that panels.py can successfully import has_image_overlays"""
    try:
        # Simulate the import as it appears in panels.py line 13
        from src.utils.constants import (
            is_free_version, get_version_badge_text, get_version_badge_icon,
            get_upgrade_hint_text, should_show_feature_lock,
            get_feature_availability_text, get_version_info_details,
            has_image_overlays, has_basic_utilities, has_presets,
            has_normal_maps, has_batch_processing, has_advanced_utilities,
            has_advanced_styling
        )
        
        # Verify has_image_overlays is imported
        assert has_image_overlays is not None
        assert callable(has_image_overlays)
        
    except ImportError as e:
        pytest.fail(f"panels.py-style import failed: {e}")


def test_all_feature_check_functions_importable():
    """Test that all feature check functions can be imported"""
    try:
        from src.utils.constants import (
            has_image_overlays,
            has_basic_utilities,
            has_presets,
            has_normal_maps,
            has_batch_processing,
            has_advanced_utilities,
            has_advanced_styling,
            has_stroke_effects,
            has_blur_effects,
            has_shadow_glow_effects,
            has_shader_generation
        )
        
        # Verify all are callable
        functions = [
            has_image_overlays,
            has_basic_utilities,
            has_presets,
            has_normal_maps,
            has_batch_processing,
            has_advanced_utilities,
            has_advanced_styling,
            has_stroke_effects,
            has_blur_effects,
            has_shadow_glow_effects,
            has_shader_generation
        ]
        
        for func in functions:
            assert callable(func), f"{func.__name__} should be callable"
            
    except ImportError as e:
        pytest.fail(f"Failed to import feature check functions: {e}")