high priority low complexity testing pending testing specialist Tier 1

Acceptance Criteria

Test: initial state — the associated TextField has obscureText: true
Test: tap toggle once — the associated TextField transitions to obscureText: false
Test: tap toggle twice — the associated TextField returns to obscureText: true
Test: initial state — Semantics label is 'Show password'
Test: after first tap — Semantics label updates to 'Hide password'
Test: after second tap — Semantics label returns to 'Show password'
Test: tester.getSize(find.byType(PasswordVisibilityToggle)) returns Size with both width and height ≥ 48.0 logical pixels
Golden test: obscured state renders correctly against design system dark background fixture
Golden test: revealed state renders correctly against design system dark background fixture
Golden tests run on both 375pt (iOS) and 360dp (Android) logical sizes
All tests are isolated — no BLoC dependency, PasswordVisibilityToggle is a stateful widget tested standalone
Tests pass with flutter test --update-goldens producing stable golden files committed to repository

Technical Requirements

frameworks
Flutter
flutter_test
performance requirements
Toggle state change reflected within a single pump() cycle (no animation delay assertions needed)
security requirements
Verify the password value itself is never surfaced in Semantics tree regardless of toggle state
ui components
PasswordVisibilityToggle widget (standalone, stateful)
Companion TextField for obscureText verification
Design token dark background colour for golden fixture

Execution Context

Execution Tier
Tier 1

Tier 1 - 540 tasks

Can start after Tier 0 completes

Implementation Notes

PasswordVisibilityToggle should be designed as a self-contained stateful widget with an obscureText bool state and an optional onToggle callback — no BLoC dependency. This makes it trivially testable in isolation. The touch target enforcement should use SizedBox(width: 48, height: 48) or a minimum-size constraint around the IconButton — verify this in the widget implementation before writing the test. For golden tests, wrap in a Container with the design system's dark background colour (from design tokens, not hardcoded hex) to ensure golden stability across theme changes.

Use addTearDown(tester.binding.window.clearPhysicalSizeTestValue) after each screen-size golden test to avoid test pollution. Golden files must be regenerated and reviewed manually whenever the design tokens change.

Testing Requirements

Pure widget tests in test/widgets/password_visibility_toggle_test.dart. Pump PasswordVisibilityToggle inside a MaterialApp with the app's ThemeData for accurate golden rendering. For obscureText verification, pass a TextEditingController and assert the companion TextField's obscureText. For semantics, use tester.ensureSemantics() and find the Semantics node by type then assert its label property.

For size test, use tester.getSize(). Golden tests use matchesGoldenFile('goldens/password_toggle_obscured.png') and 'goldens/password_toggle_revealed.png'. Run goldens on two screen sizes by using tester.binding.window.physicalSizeTestValue. Commit golden files to repository under test/goldens/.

Component
Password Visibility Toggle
ui low
Epic Risks (3)
high impact medium prob scope

Automated accessibility checks (e.g., flutter_accessibility_service) may pass while manual VoiceOver/TalkBack testing reveals focus-order issues, missing semantic roles, or live region announcements that fire too early or not at all. Discovering these late risks delaying the MVP release.

Mitigation & Contingency

Mitigation: Conduct manual VoiceOver and TalkBack testing on physical devices at the end of every sprint, not only at release. Define accessibility acceptance criteria per component and include them in the DoD. Use Semantics widgets explicitly rather than relying on implicit semantics from Flutter's default widgets for all interactive elements.

Contingency: Maintain a prioritized accessibility bug backlog separate from the main backlog. If critical VoiceOver issues are found close to release, create an explicit accessibility hotfix sprint before TestFlight distribution to Blindeforbundet testers.

medium impact medium prob technical

Keyboard height varies significantly between iOS and Android, between device sizes (iPhone SE vs iPad), and with third-party keyboards. The KeyboardAwareLayout may not correctly adjust scroll offset in all combinations, causing input fields to remain hidden behind the keyboard on certain device/keyboard configurations.

Mitigation & Contingency

Mitigation: Test on a matrix of devices including iPhone SE (small viewport), a mid-size Android phone, and a tablet. Implement the layout using MediaQuery.viewInsets.bottom rather than a fixed padding value to correctly respond to any keyboard height. Include edge cases for floating keyboards on iPads.

Contingency: If device-specific issues are found after release, implement a bottom-padding fallback using BottomPadding inset and allow users to manually scroll. Log affected device/OS combinations for targeted fixes.

high impact low prob dependency

If the design token system's colour palette is updated without re-running contrast validation, form field labels, error messages, or placeholder text could fall below the WCAG 2.2 AA 4.5:1 ratio, causing a compliance regression.

Mitigation & Contingency

Mitigation: Integrate a contrast ratio validator (e.g., a CI lint step using the contrast-ratio-validator component) that checks all colour pairs used in the login form on every pull request. Document which token pairs are used for labels, errors, and backgrounds in the login form.

Contingency: If a contrast regression is detected post-merge, hot-patch the affected design token value. Do not ship a TestFlight build with known WCAG AA failures to Blindeforbundet testers.