1.1 Utility Function Tests (src/utils/)
urlManager.js: URL parameter parsing, encoding, default values
mapUtils.js: State/location mapping functions
datasetUtils.js: Dataset configuration retrieval
forecastleValidation.js: Forecast input validation
forecastleScoring.js: Scoring calculation accuracy
Test Cases:
Valid inputs (state codes, city abbreviations, date formats)
Edge cases (empty strings, null values, malformed data)
Boundary conditions (min/max values for scales)
Data transformations (city abbr → state code mapping)
URL parameter round-trip (encode/decode)
1.2 Hook Tests (src/hooks/)
useForecastData.js: Data fetching and caching
useView.js: Context consumer validation
useQuantileForecastTraces.js: Trace data generation
useOverviewPlot.js: Plot data aggregation
useAdaptiveYRange.js: Y-axis range calculations
Test Cases
Data fetch success/failure scenarios
Missing or malformed JSON responses
File not found (404) handling
Empty datasets (no forecasts)
Different state/location combinations
Chart scale transformations (linear/log/sqrt)
Quantile presence/absence in data
1.3 Context Tests (src/contexts/ViewContext.jsx)
Location selection persistence
View type changes with state preservation
Model/date/target selection independent per view
Location validation when switching views
Chart scale/interval/legend settings persist across views
City abbreviation → state code mapping on view switch
Invalid location handling (state without MetroCast)
Success Criteria: State properly persists and validates.
2.1 StateSelector Component Tests
List renders all available states/cities
Search filters work (case-insensitive)
Location selection updates context
Keyboard navigation (arrow keys, enter)
No default highlighting when nothing selected (Bug #3 fix)
MetroCast view shows city hierarchy
Non-MetroCast view shows flat list
Mouse and keyboard interaction equity
2.2 ViewSwitchboard Component Tests
Correct view component renders per viewType
Data props passed correctly to view components
Error boundaries catch component failures
Loading state displays appropriately
View switching resets/persists state correctly
2.3 Attribution/Citation Component Tests
Attribution info displays for selected datasets
Multiple attributions visible simultaneously
Links to data sources are active
Attribution not obscured by selection menu
Citation data structure matches requirements
2.4 Chart Control Components Tests
Y-scale selection (linear/log/sqrt) applies correctly
Interval visibility (median/50%/95%) toggles work
Legend display toggle persists
Settings apply across multiple charts
Scale transformations produce correct values
3.1 View Switching Workflows
a) Flu MetroCast (city selected) → FluView
Expected: City abbr maps to state code (Bug #1 fix)
Verify: FluView loads state-level data correctly; if city abbr invalid, shows error then resets (Bug #2 fix).
b) COVID-19 (state NY) → Flu MetroCast
Expected: NY → Default MetroCast state if not supported.
Verify: No errors displayed; MetroCast loads correct default.
c) FluView (CO selected) → MetroCast
Expected: MetroCast loads Colorado data.
Verify: City list available for Colorado; UI not obscured by selection panel.
d) RSV (VA selected) → MetroCast
Expected: MetroCast loads Virginia data.
Verify: VA supported in MetroCast.
e) Return to Previous View
Expected: Previous selections restored.
Verify: URL contains view history; State persists without re-fetching.
3.2 Data Integrity Testing
Load all 13 MetroCast states: Verify no console errors, cities have correct state associations.
Load all FluSight states: Verify all metadata.json present, targets consistent, model lists complete.
Test data consistency across views: Verify ground truth data identical across views.
Empty forecast scenarios: Verify "No data available" message instead of crash.
3.3 State Persistence Testing
Session storage of URL parameters: Reload restores all selections (?view=flu_forecasts&location=CO&date=2026-03-15).
Chart settings persistence: Scale/intervals default to user choice and persist across view switches.
Model/date selection persistence: Selected models and dates stay selected when switching views or navigating back.
Invalid state recovery: Selecting invalid location → automatic reset.
3.4 Attribution/Citation Workflows
Display multiple data sources: Attribution visible for Flu + MetroCast; not cluttered.
Citation export functionality: Generates formatted bibliography matching academic standards.
Link validation: All links functional, point to official sources, and open in new tabs.
4.1 Explore Flu Forecasts: Select CO -> Denver -> Switch to FluView (Verify CO loads) -> Return to MetroCast (Verify Denver selected).
4.2 Comparative Analysis: Load Flu TX -> COVID TX -> RSV TX -> Compare attribution sources.
4.3 State Change Workflow: Load MetroCast CO -> Select Denver -> Navigate to RSV -> Automatically switches to CO-level.
4.4 Error Handling: Manually construct URL with invalid location -> Attempt unsupported combo -> Clear recovery options shown.