"""Tests for SurfAI."""

import pytest
from surfai.config import Config, ModelConfig


class TestConfig:
    """Test configuration management."""
    
    def test_model_config_creation(self):
        """Test ModelConfig creation."""
        config = ModelConfig(api_key="test-key", base_url="https://test.com")
        assert config.api_key == "test-key"
        assert config.base_url == "https://test.com"
    
    def test_config_defaults(self):
        """Test Config defaults."""
        config = Config()
        assert config.default_model == "kimi"
        assert config.models == {}


class TestBrowser:
    """Test browser functionality."""
    
    @pytest.mark.asyncio
    async def test_browser_init(self):
        """Test browser initialization."""
        from surfai.browser import Browser
        browser = Browser()
        assert browser.headless is True
        assert browser.model is None
    
    @pytest.mark.asyncio
    async def test_browser_url_normalization(self):
        """Test URL normalization in goto."""
        from surfai.browser import Browser
        browser = Browser()
        # This would need a mocked page to fully test
        assert browser is not None
