"""Unit tests for Config class."""

from pathlib import Path

from electron_angle_patcher import Config


class TestConfig:
    """Tests for Config class."""

    def test_default_paths(self) -> None:
        """Test default paths are configured correctly."""
        assert Path("/Applications/Brave Browser.app") == Config.DEFAULT_BRAVE_PATH
        assert Path("/Applications/lghub.app") == Config.DEFAULT_LGHUB_PATH

    def test_standard_scan_dirs(self) -> None:
        """Test standard scan directories are configured."""
        assert len(Config.STANDARD_SCAN_DIRS) > 0
        assert all(isinstance(d, str) for d in Config.STANDARD_SCAN_DIRS)
        assert any("Library" in d for d in Config.STANDARD_SCAN_DIRS)

    def test_specific_apps(self) -> None:
        """Test specific apps configuration."""
        assert len(Config.SPECIFIC_APPS) > 0
        assert all(isinstance(p, Path) for p in Config.SPECIFIC_APPS.values())
        assert "Logitech G Hub (Standard)" in Config.SPECIFIC_APPS
        assert "Microsoft Teams (Classic)" in Config.SPECIFIC_APPS

    def test_skip_dirs_is_frozenset(self) -> None:
        """Test SKIP_DIRS is a frozenset for immutability."""
        assert isinstance(Config.SKIP_DIRS, frozenset)
        assert ".Trash" in Config.SKIP_DIRS
        assert "node_modules" in Config.SKIP_DIRS

    def test_generic_folder_names(self) -> None:
        """Test generic folder names for app name detection."""
        assert isinstance(Config.GENERIC_FOLDER_NAMES, frozenset)
        assert "EBWebView" in Config.GENERIC_FOLDER_NAMES
        assert "Application Support" in Config.GENERIC_FOLDER_NAMES

    def test_network_fs_types(self) -> None:
        """Test network filesystem types for mount detection."""
        assert isinstance(Config.NETWORK_FS_TYPES, frozenset)
        assert "nfs" in Config.NETWORK_FS_TYPES
        assert "smbfs" in Config.NETWORK_FS_TYPES

    def test_executable_permissions(self) -> None:
        """Test executable permissions constant."""
        assert Config.EXECUTABLE_PERMISSIONS == 0o755

    def test_wrapper_template(self) -> None:
        """Test wrapper script template."""
        assert "{original_executable}" in Config.WRAPPER_TEMPLATE
        assert "{args}" in Config.WRAPPER_TEMPLATE
        assert "#!/bin/bash" in Config.WRAPPER_TEMPLATE
