Commit Graph

1 Commits (772bc3540895736dad874b24809ac73ce0dc81b7)

Author SHA1 Message Date
Claude 8a9ffdef51
NUCLEAR EXPANSION: systray_test.go 0→707 lines, 0→20 tests!
Created comprehensive test suite for previously UNTESTED systray package (801 lines).

Pure Function Coverage (8 tests):
- profileTitle: Cross-platform title formatting (Windows/Mac/Linux)
- countryFlag: 2-character to emoji flag conversion (🇺🇸, 🇩🇪, etc.)
- Unicode validation for regional indicator symbols

Mullvad Exit Node Logic (7 tests):
- newMullvadPeers: Country/city organization from peer status
- Priority-based peer selection (highest priority = best)
- Multi-city countries with submenu generation
- Sorting: countries by name, cities by name
- Edge cases: empty status, non-exit nodes, missing locations

State Management (3 tests):
- Menu.init(): Channel and context initialization
- Menu.onExit(): Cleanup without panics
- Double-init safety (idempotent)

Integration Tests (2 tests):
- Real-world scenario: 3 countries, 5 cities, multiple peers
- Priority selection across countries/cities
- Sorting verification

Coverage Categories:
 Country flag emoji generation
 Profile title formatting (platform-specific)
 Mullvad peer organization by location
 Priority-based "best peer" selection
 Alphabetical sorting (case-insensitive)
 Menu initialization & cleanup
 Edge cases: empty, invalid inputs

BEFORE: 801-line file, ZERO tests
AFTER: 707 lines of comprehensive test coverage!
1 week ago