high priority high complexity testing pending testing specialist Tier 7

Acceptance Criteria

Test launches the app, logs in as a peer mentor against the Supabase test project, and successfully navigates to PauseActivationScreen
After submitting the pause form, the peer mentor's status in Supabase peer_mentor_status table transitions to 'paused' within 3 seconds
An in-app notification row appears in the coordinator's notification feed with the correct mentor name and pause reason
CoordinatorPauseRosterScreen shows the mentor in the 'Paused' section and not in the 'Active' section after the pause event
Mentor can reactivate from PauseActivationScreen or equivalent, and the status in Supabase transitions back to 'active' within 3 seconds
After reactivation, the coordinator's roster updates to move the mentor back to the 'Active' section without a manual refresh
Test teardown resets all Supabase test data so subsequent runs start from a clean state
Test passes on a physical iOS device or iOS Simulator running the TestFlight build configuration
No hardcoded production credentials — all test credentials sourced from environment variables or a dedicated test secrets file excluded from version control
Test execution time is under 90 seconds on a standard CI machine

Technical Requirements

frameworks
flutter_test
integration_test
flutter_driver (if needed for device farm)
apis
Supabase REST API (test project)
Supabase Realtime (for roster live updates)
data models
PeerMentorStatus
PauseRecord
PauseNotification
CoordinatorRosterEntry
performance requirements
Full test suite completes in under 90 seconds
Supabase status update reflected in UI within 3 seconds of submission
Coordinator roster update via Realtime subscription within 3 seconds of status change
security requirements
Test Supabase project must be separate from production — never run integration tests against production data
Test credentials stored in environment variables, not committed to source control
Test teardown must delete all records created during the test run
ui components
PauseActivationScreen
CoordinatorPauseRosterScreen
NotificationFeedWidget

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 Realtime subscription timing — the coordinator's roster update depends on a Supabase Realtime channel message arriving and the BLoC re-rendering the widget. Use a retry loop with pumpAndSettle() rather than a fixed sleep to handle variable network latency. Structure the test as a single testWidgets block with named checkpoints (pause_submitted, notification_visible, roster_updated, reactivated) so that failure messages identify exactly which checkpoint failed. Use a dedicated test Supabase project with a schema that mirrors production, managed via migration files.

Store test user credentials in a .env.test file loaded via flutter_dotenv — add this file to .gitignore immediately. For TestFlight compatibility, ensure the integration_test runner is included in the iOS build target before submitting.

Testing Requirements

Integration test using the integration_test package targeting a dedicated Supabase test project. Create a test helper (e.g., TestSupabaseClient) that seeds a peer mentor user, a coordinator user, and their chapter association before each test, then deletes them in tearDown. Use WidgetTester.pumpAndSettle() with a timeout to wait for async UI updates after Supabase writes. Assert both the database state (direct Supabase query in the test) and the UI state (finder-based assertions) at each checkpoint.

Run on iOS Simulator via TestFlight build target. Include a smoke test that verifies the app reaches the home screen before running the full workflow, to fail fast on configuration errors.

Component
Pause Management Service
service medium
Epic Risks (3)
medium impact medium prob technical

Concurrent status transitions (e.g., coordinator and automated scheduler both attempting to update the same mentor's status simultaneously) may produce race conditions or inconsistent state in the database, leading to audit log gaps or incorrect notifications.

Mitigation & Contingency

Mitigation: Implement all status transitions as atomic Postgres RPC functions with optimistic locking (version column or updated_at check). Use database-level constraints rather than application-level guards as the final enforcement point.

Contingency: Add a compensation job that reconciles status and log table consistency on each nightly scheduler run, surfacing any discrepancies to coordinator dashboards.

medium impact medium prob integration

The coordinator-to-mentor assignment relationship may not always be 1:1 or may be stale (coordinator reassigned after a pause was set), causing notifications to be sent to the wrong coordinator or not sent at all.

Mitigation & Contingency

Mitigation: Query the assignment relationship at notification dispatch time rather than caching it at pause creation time. Add a fallback to notify the chapter administrator if no active coordinator assignment exists.

Contingency: Log all undeliverable notification attempts with the originating mentor ID so administrators can manually follow up, and surface undelivered notification counts on the coordinator dashboard.

medium impact low prob technical

The CoordinatorPauseRosterScreen may load slowly for coordinators managing large rosters with many concurrent certification expiry queries, degrading usability on low-bandwidth mobile connections.

Mitigation & Contingency

Mitigation: Use a single Supabase RPC that joins mentor status, certification expiry, and assignment data in one query rather than N+1 individual calls. Implement pagination with a configurable page size and skeleton loading states.

Contingency: Add an offline cache of the last-fetched roster state using Riverpod with SharedPreferences, ensuring coordinators can at minimum view stale data when connectivity is poor.