critical priority high complexity testing pending testing specialist Tier 7

Acceptance Criteria

Test opens the map screen as a coordinator role user and verifies that at least one MapMarkerWidget is rendered within 3 seconds of screen open
Test opens the filter panel, selects 'Available only' filter, and verifies that only markers with availability=available are rendered after the filter is applied
Test taps an available mentor marker and verifies the MentorInfoPopup appears within 500ms (no loading spinner — data must come from pre-loaded BLoC state)
Test taps the deep-link button in the popup and verifies navigation to the peer mentor detail screen with the correct mentor ID in the route
Test uses the back navigation to return to the map screen and verifies the filter state is still 'Available only' (not reset by navigation)
Test taps the view toggle button and verifies the MentorListFallback is displayed with the same filtered set of mentors (count matches filtered marker count)
Test verifies the list item count equals the number of markers that were visible with the 'Available only' filter applied
Test taps the view toggle button again and verifies return to map view with the 'Available only' filter still active and markers still filtered
Full test suite passes on iOS simulator (iPhone 14, iOS 16+) and Android emulator (Pixel 6, Android 13+) in CI
Test completes end-to-end in under 60 seconds on CI hardware

Technical Requirements

frameworks
Flutter
flutter_test
integration_test
BLoC
apis
Supabase REST API (stubbed via WireMock or MockSupabase for CI)
data models
PeerMentor
MapFilterState
AvailabilityState
performance requirements
Popup must appear within 500ms of marker tap — assert no loading state in popup
Map screen initial load with markers must complete within 3 seconds on CI simulators
Full integration test must complete in under 60 seconds
security requirements
Integration test must use a dedicated test Supabase project or a fully stubbed HTTP layer — never run against production data
Test user credentials must be stored in CI environment variables, never in source code
ui components
MapViewScreen
MapMarkerWidget
ViewToggleButton
MentorInfoPopup
MentorListFallback
MapFilterPanel

Execution Context

Execution Tier
Tier 7

Tier 7 - 84 tasks

Can start after Tier 6 completes

Implementation Notes

The biggest risk in this test is map tile rendering — real map tiles require network access and can be slow or unavailable in CI. Configure the map plugin to use an offline tile provider or a blank tile source in test mode, controlled by a build-time constant (e.g., const bool.fromEnvironment('INTEGRATION_TEST')). For marker count assertions, assign a Key('map-marker-{mentorId}') to each MapMarkerWidget so you can find them precisely. The popup 500ms timing assertion should use tester.pump(Duration(milliseconds: 500)) then assert the popup is visible — avoid pumpAndSettle for timing-sensitive checks.

Use a fixture class that generates consistent PeerMentor test data by ID so assertions are stable across runs. Ensure back navigation in the test uses tester.pageBack() rather than hardware back button simulation for cross-platform consistency.

Testing Requirements

Flutter integration test using the integration_test package. Stub all Supabase calls with deterministic seed data (minimum 10 mentors, mixed availability states, 3+ specialisations). Use testWidgets() with a WidgetTester and IntegrationTestWidgetsFlutterBinding.ensureInitialized(). Assert UI state after each user action using find.byType(), find.byKey(), and find.bySemanticsLabel().

Marker count assertions: count rendered MapMarkerWidget instances and compare to expected filtered set size. Configure the test to run in CI via GitHub Actions (or equivalent) using flutter test integration_test/ --device-id= and the Android equivalent. Test must be deterministic — seed data is fixed, no random or time-dependent behaviour.

Component
Map View Screen
ui high
Dependencies (5)
Write Flutter widget tests for MapFilterPanel covering: panel collapses and expands correctly, each filter control emits the correct FilterChanged event, multi-select specialisation chips update selection state visually and semantically, drag handle has correct semantic label, and filter changes propagate to the parent BLoC without re-fetching data. epic-geographic-peer-mentor-map-ui-accessibility-task-016 Implement the deep-link navigation action from MentorInfoPopup to the peer mentor detail screen. On button tap, push the peer mentor detail route with the mentor ID. Ensure the navigation preserves the map state so the back button returns to the map with filters intact. Validate that the deep-link button has correct semantic role (button) and label ('View profile of [mentor name]'). epic-geographic-peer-mentor-map-ui-accessibility-task-008 Write Flutter widget tests covering MapMarkerWidget and ViewToggleButton. Test cases must include: marker renders with correct colour for each availability state, marker semantics label is correct, toggle button label updates on state change, toggle does not reset filter state, and minimum touch target size is met. Use flutter_test with semantic tree matchers. epic-geographic-peer-mentor-map-ui-accessibility-task-014 Write Flutter widget tests for MentorInfoPopup and MentorListFallback. Popup tests: loads from BLoC state without network call, focus trap is active, close button dismisses popup, deep-link button navigates correctly. List fallback tests: renders all filtered mentors, live region announces count update, each item has correct semantic label, view toggle preserves list position. epic-geographic-peer-mentor-map-ui-accessibility-task-015 Perform a manual WCAG 2.2 AA accessibility audit on all six map UI components using VoiceOver (iOS) and TalkBack (Android). Audit checklist: all interactive elements reachable and labelled, focus order is logical, colour is not the only conveyor of information, contrast ratios pass AA thresholds, no content is inaccessible when screen reader is active, and the list fallback provides full feature parity with the map view for screen reader users. Document all findings and create fix tasks for any failures. epic-geographic-peer-mentor-map-ui-accessibility-task-017
Epic Risks (3)
high impact high prob technical

Flutter's map canvas (flutter_map) does not natively support semantic focus traversal for screen readers, meaning map markers may be entirely invisible to VoiceOver/TalkBack users. If the accessible list fallback is not treated as a first-class view, screen reader users will have no access to the feature.

Mitigation & Contingency

Mitigation: From sprint 1, treat mentor-list-fallback as a fully featured primary view, not an afterthought. Implement and test it in parallel with the map canvas. Make the view-toggle-button keyboard focusable and announced on every screen state. Conduct VoiceOver testing on device before submitting each PR touching UI components.

Contingency: If map canvas accessibility cannot be achieved for marker focus traversal, make the view-toggle-button the default focus target on screen load for VoiceOver users (detected via screen-reader-detection-service) so they are immediately directed to the list fallback without needing to discover the toggle.

medium impact medium prob technical

The mentor-info-popup must occupy no more than 40% of visible map area on small screens. On devices with screen heights under 667px (iPhone SE), overlapping with the filter panel or obscuring most of the map could severely degrade usability.

Mitigation & Contingency

Mitigation: Implement the popup as a bottom sheet capped at 40% of screen height with a ScrollView for overflow content. Test on iPhone SE (375x667pt) and the smallest commonly used Android form factor in the device lab. Define max-height as a percentage constant in location-privacy-config or design tokens.

Contingency: If the popup cannot fit all required fields within 40% height on smallest targets, truncate assigned contact count and certification badge to icons-only in the compact view, with a 'View Profile' button always visible at the bottom of the popup regardless of scroll position.

medium impact medium prob integration

Filter state must remain perfectly synchronised between the map view and the list fallback. If the filter panel emits state that is not consumed identically by both views, coordinators switching between views will see inconsistent mentor sets, eroding trust in the feature.

Mitigation & Contingency

Mitigation: Store active filter criteria in a single shared Riverpod provider owned by the map-view-screen and consumed by both map-marker-widget (via mentor-location-service) and mentor-list-fallback. Write integration tests that apply a filter, switch views, and assert identical mentor counts in both views.

Contingency: If filter sync proves brittle, simplify to a single filter state object passed explicitly as a constructor argument to both views on each rebuild, eliminating indirect state sharing.