critical priority low complexity frontend pending frontend specialist Tier 0

Acceptance Criteria

A ContactFixtures class (or top-level constants file) is created in test/fixtures/contact_fixtures.dart and is importable by all widget tests in the epic
Fixtures include at minimum: mockCoordinatorContact (Contact with all fields populated), mockPeerMentor (PeerMentor with certificationStatus active + future expiry), mockPeerMentorExpiredCert (PeerMentor with past certification expiry date), mockContactNullNotes (Contact with notes == null), mockContactLongNotes (Contact with notes > 200 characters to validate ellipsis truncation), mockContactList (List<Contact> with 5+ mixed coordinator and peer_mentor records)
Each fixture uses realistic-looking but clearly fake data (e.g., 'Anna Testperson', 'Testlaget Oslo') — no real personal information
Fixtures use the same Contact and PeerMentor model classes from the domain layer (task-005), not separate test-only classes, ensuring type compatibility
organizationLabel field in fixtures is a plain String (resolved label text, not an ID) to simulate the output of the org-labels provider
File includes a brief comment explaining the intended use case of each fixture constant
All fixtures compile without errors and are referenced by at least one widget test before this task is closed

Technical Requirements

frameworks
Flutter
Dart
flutter_test
data models
Contact
PeerMentor
ContactRole
AssignmentStatus
performance requirements
Fixture instantiation must be synchronous and impose no I/O
security requirements
No real user data, email addresses, or phone numbers in fixture constants

Execution Context

Execution Tier
Tier 0

Tier 0 - 440 tasks

Implementation Notes

Place the file at test/fixtures/contact_fixtures.dart, not in lib/ — test fixtures are test-only code. Use const constructors where the model supports it (if using freezed or const-compatible models) for zero-cost instantiation. Mirror the field structure agreed in task-005 exactly — if that task changes the model schema, update fixtures accordingly. Consider organizing fixtures into a static class with named getters rather than top-level variables to avoid polluting the test namespace and make autocomplete cleaner.

The mockPeerMentorExpiredCert fixture is particularly important for validating certification warning UI in downstream widget tests.

Testing Requirements

No direct tests needed for the fixture file itself — correctness is validated by the widget tests that consume them. However, run a quick compile check (flutter analyze test/fixtures/) and ensure all fixtures are typed correctly (no dynamic).

Consider adding a single smoke test that asserts ContactFixtures.mockContactList.length > 0 to catch accidental emptying of the list.

Component
Contact Card Widget
ui low
Epic Risks (2)
medium impact medium prob technical

Design token color values used in role badges, certification status indicators, and availability chips may not meet the WCAG 2.2 AA contrast ratio of 4.5:1 when rendered against card backgrounds, requiring rework after accessibility review and potentially blocking acceptance sign-off.

Mitigation & Contingency

Mitigation: Run the contrast-ratio-validator on every new token combination during widget development. Enforce the CI accessibility lint runner on all PRs touching visualization components, and validate against the contrast-safe-color-palette before finalizing card designs.

Contingency: If contrast failures are found late, adjust token values in the design token theme centrally — since all widgets consume design tokens rather than hardcoded colors, all affected widgets will be corrected by a single token update without per-widget changes.

low impact medium prob dependency

The ContactViewSwitcher is required for Barnekreftforeningen but must not appear for other organizations. If the organization labels provider does not yet expose a reliable feature flag for this widget, it may render universally or be conditionally hidden in an inconsistent way, breaking the role-specific layout contract.

Mitigation & Contingency

Mitigation: Implement view switcher visibility as a constructor parameter on ContactListScreen injected from a provider, defaulting to hidden. Document the integration point for the org labels provider so the flag can be wired without changing the widget's API.

Contingency: If org labels integration is delayed beyond this epic, use a feature flag constant keyed to the Barnekreftforeningen organization ID as a temporary gate, with a tracked issue to replace it with the runtime labels provider before general release.