high priority medium complexity testing pending testing specialist Tier 4

Acceptance Criteria

OrgLabelsProvider: test emits correct label map when stream fires, test falls back to default labels when stream is empty or errors
CertificationStatusBadge: three state tests (active, expiring-soon, expired) × two size tests (standard, compact) = 6 test cases minimum; each asserts correct icon, label text, and color token
CertificationAlertBanner: shown when org is HLF and cert is expiring/expired; hidden (returns SizedBox.shrink or equivalent) for non-HLF orgs; countdown displays correct remaining days from a fixed mock DateTime
PeerMentorProfileHeader: renders CircleAvatar with network image when avatarUrl is provided; renders initials avatar when avatarUrl is null; renders error placeholder when image load fails
AssignedContactsList: renders correct number of contact cards for a populated list; renders empty-state widget when list is empty; Blindeforbundet badge visible only when org is Blindeforbundet
MentorActivitySummaryPanel: renders activity type breakdown rows when data is provided; renders empty-state message when activity list is empty; onTap callback fires on tap
Overall branch coverage ≥80% as reported by `flutter test --coverage` + lcov
All tests pass without network calls — all external dependencies are faked or mocked
No test shares mutable state with another test (each test calls setUp/tearDown or uses fresh widget pump)

Technical Requirements

frameworks
Flutter
flutter_test
mockito or mocktail (if needed for stream mocks)
data models
OrgLabels
CertificationStatus
PeerMentorProfile
AssignedContact
MentorActivitySummary
performance requirements
Full test suite for this file completes in under 60 seconds on CI
No real async timers — use FakeAsync or pump(Duration) for time-based widgets
security requirements
No real Supabase credentials or tokens used in tests — all auth context is injected via fakes
ui components
OrgLabelsProvider
CertificationStatusBadge
CertificationAlertBanner
PeerMentorProfileHeader
AssignedContactsList
MentorActivitySummaryPanel

Execution Context

Execution Tier
Tier 4

Tier 4 - 323 tasks

Can start after Tier 3 completes

Implementation Notes

Group all tests under a single `group('PeerMentorDetailScreen UI Widgets', ...)` with nested groups per widget. For image-loading tests in PeerMentorProfileHeader, register a fake `HttpClientRequest` or use the `FakeHttpClient` approach so network image tests are hermetic. For the CertificationAlertBanner countdown, inject a `DateTime now` parameter or use a `Clock` abstraction so tests can set a fixed reference date without `DateTime.now()`. Avoid snapshot-style string matching on rendered text; prefer `find.text(...)` with exact strings derived from the same constants the widgets use, to prevent brittle tests.

Ensure each test file imports only from the `lib/` barrel — never from other test files.

Testing Requirements

Exclusively widget tests using flutter_test. Organize tests in one file per widget or a single grouped file (group() per widget). Use `testWidgets` for all cases. Inject dependencies via constructor parameters or InheritedWidget/Provider fakes — do not rely on global singletons.

Use `StreamController` fakes for OrgLabelsProvider stream tests. Use `FakeAsync` / `tester.pump(Duration(...))` for countdown timer assertions. After all tests pass, run `flutter test --coverage` and generate lcov report; assert total branch coverage ≥80% in CI via `lcov --summary`.

Component
Certification Status Badge
ui low
Dependencies (5)
Ensure CertificationAlertBanner meets WCAG 2.2 AA: verify banner background-to-text contrast ratio, add Semantics node with a live-region label so screen readers announce the alert when it appears, and confirm the Enroll CTA has a minimum 44x44dp touch target. Test with both VoiceOver (iOS) and TalkBack (Android) in the expired and expiring-soon states. epic-peer-mentor-detail-screen-ui-components-task-006 Add merged Semantics to PeerMentorProfileHeader so VoiceOver reads the header as a single announcement: name, role, and certification status combined. Verify avatar fallback initials have sufficient contrast against their generated background color. Ensure the error-state HLF cert ring color passes AA contrast against both light and dark backgrounds. epic-peer-mentor-detail-screen-ui-components-task-008 Extend AssignedContactsList rows to display a Blindeforbundet-specific badge showing the open assignment count and deadline for the 3rd and 15th assignment thresholds (office-fee triggers). Badge must be conditionally rendered only for Blindeforbundet orgs using OrgLabelsProvider org type flag. Visually distinguish the 3rd and 15th threshold milestones with different badge colors. epic-peer-mentor-detail-screen-ui-components-task-010 Make MentorActivitySummaryPanel tappable: wrapping the card in an InkWell that calls an onTap callback to navigate to the full activity log screen. Add Semantics label describing total activities and a hint indicating it navigates to the log. Verify the card and type breakdown rows meet WCAG 2.2 AA contrast, and add ExcludeSemantics to decorative count bars if present. epic-peer-mentor-detail-screen-ui-components-task-012 Wrap CertificationStatusBadge in Flutter Semantics with a human-readable label computed from the expiry state (e.g., 'Certification valid until 12 March 2026', 'Certification expired 3 days ago'). Ensure VoiceOver and TalkBack announce the label when the widget receives focus. Verify WCAG 2.2 AA contrast ratios for all three visual states against the design token palette. epic-peer-mentor-detail-screen-ui-components-task-004
Epic Risks (2)
medium impact medium prob dependency

The org labels system may not yet have label keys defined for peer mentor detail screen terminology (role labels, section headings), requiring additions to the label key registry that must be coordinated with the admin configuration team.

Mitigation & Contingency

Mitigation: Audit existing label keys in the terminology system before starting OrgLabelsProvider integration. Submit required new label keys for admin configuration in parallel with component implementation.

Contingency: If label keys are not available at integration time, use hardcoded English fallbacks with a clear TODO for admin configuration, ensuring the widget renders correctly while keys are being provisioned.

high impact low prob technical

The design token semantic colors (warning, error surface) may not meet WCAG 2.2 AA 4.5:1 contrast ratio when rendered on the app's background surface tokens, requiring design system changes that affect the entire app.

Mitigation & Contingency

Mitigation: Run contrast ratio validation on the token palette during Epic 1 design token implementation. Flag any failing pairs to the design system owner before building UI components that depend on them.

Contingency: If tokens fail contrast requirements, define supplementary high-contrast override tokens specific to alert and badge contexts that meet AA without modifying the global palette.