OctoWeatherOctoWeather

OctoWeather Unit Tests

Cache / Location Key

Same coords with different precision produce identical key
Nearby coords within 0.01° share the same key
Coords more than ~1km apart produce different keys
Key format is always "lat_lng" with 2dp

UV Index

UV 0 → Low
UV 2 → Low (boundary)
UV 3 → Moderate
UV 7 → High (boundary)
UV 11 → Extreme

Weather Codes

Code 0 → Clear
Code 95 → Thunderstorm
Unknown code → Unknown

Health Alerts

Low pressure triggers pressure_low alert
Normal pressure produces no pressure alert
High humidity triggers humidity_high alert
UV ≥ 6 triggers uv_high alert
Temp drop ≥ 10°F over 3h triggers temp_drop
No alerts on benign conditions

WeatherSpirit

Rainy condition → rainy sprite
Thunderstorm → rainy sprite
Clear daytime → sunny sprite
Clear nighttime → night sprite
Snow → night sprite
Unknown condition daytime → sunny sprite
Unknown condition nighttime → night sprite

CSS Animations

animate-sun-pulse class has animation property in stylesheet
animate-cloud-drift class has animation property in stylesheet
animate-float class has animation property in stylesheet
animate-wiggle class has animation property in stylesheet
prefers-reduced-motion does not fully suppress custom animations

Geolocation

navigator.geolocation API is available in this browser
Nominatim reverse-geocode returns a usable city name for New York coords
Nominatim reverse-geocode returns a usable city name for Los Angeles coords
Open-Meteo geocoding returns results for "Miami"
Open-Meteo geocoding returns results for "London"
Open-Meteo geocoding returns empty results for nonsense query

Location Names

US city → "City, ST" (2-letter abbreviation)
US city — Washington DC → "Washington, DC"
Canada → "City, Province abbr"
Mexico → "City, Full State"
International → "City, Country"
formatGeoResult — Open-Meteo US result
formatGeoResult — Open-Meteo international result
formatNominatimAddress — US GPS reverse geocode
formatNominatimAddress — Canadian city
formatNominatimAddress — International city
Country code is case-insensitive
No bare city-only names for US cities with known states

Map Z-Index

Layer selector has z-index 2000 (from class z-[2000])
Map legend has z-index 1000 (from class z-[1000])
Layer selector z-index is strictly greater than map legend z-index
Gap between selector and legend z-index is at least 1000

API Smoke Tests

getWeatherData returns valid structure for New York
getWeatherData location_key matches normalized coords
UV index is a number ≥ 0 in response
Click "Run All Tests" to validate the app's core logic and API.