"""pytest configuration and fixtures"""

import json
from pathlib import Path
import pytest


@pytest.fixture
def fixtures_dir():
    """Return path to fixtures directory"""
    return Path(__file__).parent / "fixtures"


@pytest.fixture
def valid_project_data(fixtures_dir):
    """Load valid project JSON fixture"""
    with open(fixtures_dir / "valid_project.json") as f:
        return json.load(f)


@pytest.fixture
def heroui_theme_data(fixtures_dir):
    """Load HeroUI theme JSON fixture"""
    with open(fixtures_dir / "heroui_theme.json") as f:
        return json.load(f)


@pytest.fixture
def shadcn_button_data(fixtures_dir):
    """Load shadcn button component fixture"""
    with open(fixtures_dir / "shadcn_button.json") as f:
        return json.load(f)


@pytest.fixture
def api_keys_data(fixtures_dir):
    """Load API keys fixture with mock keys for testing"""
    with open(fixtures_dir / "api_keys.json") as f:
        return json.load(f)


@pytest.fixture
def mock_anthropic_key(api_keys_data):
    """Get mock Anthropic API key for testing"""
    return api_keys_data["anthropic"]["mock_api_key"]


@pytest.fixture
def mock_figma_token(api_keys_data):
    """Get mock Figma token for testing"""
    return api_keys_data["figma"]["mock_token"]


@pytest.fixture
def mock_figma_file_key(api_keys_data):
    """Get mock Figma file key for testing"""
    return api_keys_data["figma"]["mock_file_key"]


@pytest.fixture
def mock_figma_response(api_keys_data):
    """Get mock Figma API response for testing"""
    return api_keys_data["mock_responses"]["figma"]["variables_response"]


@pytest.fixture
def mock_claude_response(api_keys_data):
    """Get mock Claude API response for testing"""
    return api_keys_data["mock_responses"]["claude"]["simple_response"]
