medium priority medium complexity testing pending testing specialist Tier 4

Acceptance Criteria

Widget test suite achieves ≥ 90% line coverage across all three components (ReminderNotificationCard, CoordinatorEscalationNotificationCard, ReminderThresholdSettingsUI)
ReminderNotificationCard test: correct elapsed day count renders for a given reminder date
ReminderNotificationCard test: tapping dismiss emits the correct BLoC/Riverpod dismiss event with the correct reminder ID
ReminderNotificationCard test: tapping mark-read emits the correct mark-read event with the correct reminder ID
CoordinatorEscalationNotificationCard test: peer mentor name is rendered from the escalation data
CoordinatorEscalationNotificationCard test: tapping acknowledge emits the correct acknowledgement event with escalation ID
CoordinatorEscalationNotificationCard test: acknowledged state removes or disables the acknowledge button
ReminderThresholdSettingsUI test: invalid input combinations each produce their specific inline error messages
ReminderThresholdSettingsUI test: valid input triggers repository save with correct values
Golden tests exist for all three components in their default, loading, and error states; goldens are committed and CI fails on visual regression
Semantics assertions verify all interactive elements have non-empty labels and error texts are marked as liveRegions
All tests pass with zero flaky failures across 10 consecutive runs in CI

Technical Requirements

frameworks
Flutter
flutter_test
BLoC
Riverpod
data models
assignment
performance requirements
Full widget test suite must complete in under 60 seconds in CI
Golden image generation must not require a network connection
security requirements
Test fixtures must not contain real PII — use synthetic names and IDs

Execution Context

Execution Tier
Tier 4

Tier 4 - 323 tasks

Can start after Tier 3 completes

Implementation Notes

Organise test files to mirror the source structure: test/widgets/reminder_notification_card_test.dart, coordinator_escalation_notification_card_test.dart, reminder_threshold_settings_ui_test.dart. For golden tests, use a dedicated goldens/ directory and a custom Flutter test configuration that pins the canvas size. When testing BLoC event emissions, use blocTest from bloc_test package's act/expect pattern — do not use raw StreamController assertions. For Riverpod tests, override providers using ProviderContainer or ProviderScope in the test widget tree.

For the elapsed days calculation, inject a fixed clock (DateTime.now override via a test utility) so the golden and assertion values are deterministic. Commit golden files to the repository; document the Flutter version used for golden generation in a comment at the top of each golden test file to prevent CI drift.

Testing Requirements

Use flutter_test for all widget tests. Use MockBloc (bloc_test package) for BLoC event assertions and Riverpod ProviderScope overrides for Riverpod provider injection. Golden tests use matchesGoldenFile() — generate goldens on a pinned Flutter version to avoid font rendering differences across environments. Semantics tests use tester.getSemantics(find.byType(...)) to assert label and liveRegion properties.

Structure tests in describe/group blocks per component. CI pipeline must run flutter test --coverage and fail if coverage drops below 90% for the three component files. Flakiness prevention: avoid timers or delays in widget tests; use fake async where timing matters.

Component
Reminder Notification Card
ui low
Epic Risks (2)
medium impact medium prob integration

The deep-link from the notification card to the assignment detail screen depends on the assignment detail route being stable and accepting an assignment ID parameter. If the routing contract is undocumented or changes during parallel development, the CTA will silently navigate to a fallback screen.

Mitigation & Contingency

Mitigation: Confirm the assignment detail route path and parameter contract with the team building or maintaining that screen before implementing the CTA. Add an integration test that asserts navigating from a mock notification card with a known assignment ID lands on the correct route.

Contingency: If the route is unstable, implement the deep-link as a late-bound string resolved from a central route registry, allowing the target route to be updated without changing the notification card.

medium impact medium prob technical

Visually distinguishing escalation cards from standard reminder cards using colour alone fails WCAG 1.4.1 (use of colour). Blindeforbundet users relying on screen readers must receive equivalent contextual information through semantics, not just visual styling.

Mitigation & Contingency

Mitigation: Use both colour and an icon/label difference to distinguish card types. Add explicit Semantics widgets with descriptive labels ('Escalation alert: peer mentor has not responded') so screen readers announce the type without visual context.

Contingency: If accessibility review flags the distinction, add a text badge ('Escalation') alongside the visual treatment as a code-change-only fix with no schema or service impact.