high priority medium complexity testing pending testing specialist Tier 5

Acceptance Criteria

WizardProgressIndicator tests: renders correct number of step indicators (1–5), throws AssertionError or renders error state when stepCount > 5, each step indicator has a Semantics label matching 'Step N of M', completed steps have distinct visual and semantic state from active/future steps
LabelledNavigationBar tests: all tab labels are visible (not icon-only), each tab's touch target is at least 48x48 logical pixels, tapping a tab triggers the correct onTap callback, each tab item has a Semantics widget with label and selected state
SingleActionScreenLayout tests: only one primary CTA button is rendered per screen instance, back button is present and triggers navigator pop, choice count never exceeds the defined limit (assert on rendered choice widgets), layout renders without overflow on 320px-wide viewport
PlainLanguageErrorDisplay tests: renders headline and actionable instruction as separate text nodes, Semantics widget wrapping the error has liveRegion: true, widget renders correctly with both short and long message strings, error color token matches AccessibilityDesignTokenEnforcer values
InlineContextualHelpWidget tests: widget is collapsed by default, tapping expand button transitions to expanded state, tapping collapse returns to collapsed state, Semantics node announces 'expanded' or 'collapsed' on state change
ConfirmBeforeSubmitScreen tests: all user-entered field values appear in the summary with correct labels, tapping submit calls the provided onSubmit callback exactly once, tapping back navigates without calling onSubmit, submit button is disabled while submission is in progress
All tests pass with flutter_test on both iOS and Android widget layers
Total test count >= 30 (at least 5 per component), all passing before merge

Technical Requirements

frameworks
Flutter
flutter_test
BLoC
data models
accessibility_preferences
performance requirements
Each widget test must complete in under 500ms
No real async IO in widget tests — all dependencies stubbed
security requirements
No real user PII used in test fixtures — use anonymised strings only
ui components
WizardProgressIndicator
LabelledNavigationBar
SingleActionScreenLayout
PlainLanguageErrorDisplay
InlineContextualHelpWidget
ConfirmBeforeSubmitScreen

Execution Context

Execution Tier
Tier 5

Tier 5 - 253 tasks

Can start after Tier 4 completes

Implementation Notes

Start by creating a shared test helpers file (e.g., test/helpers/accessibility_test_helpers.dart) with utilities for pumping components with required providers and design token theme. For liveRegion semantics assertions, use SemanticsHandle via tester.ensureSemantics() before asserting. When testing touch targets, use tester.getSize(find.byType(X)) and assert width >= 48 && height >= 48 in logical pixels. For the 5-step limit on WizardProgressIndicator, test both the boundary (5 steps, valid) and the violation (6 steps, should assert/throw).

Use GoldenToolkit or simple find-based assertions — avoid screenshot goldens as they are fragile across platforms. Keep each test group in its own file mirroring the component name (e.g., test/widgets/wizard_progress_indicator_test.dart).

Testing Requirements

Widget tests only (flutter_test WidgetTester). Use pumpWidget + tester.tap/tester.pump pattern. Use find.bySemanticsLabel to assert screen-reader-facing semantics. Use find.byType to count rendered widgets.

Group tests per component using group(). Mock all BLoC dependencies with MockBloc (bloc_test). Assert Semantics tree shape with tester.getSemantics(). Run tests with flutter test — no emulator required.

Target: 100% of specified acceptance criteria covered by at least one test case.

Component
Single-Action Screen Layout
ui medium
Dependencies (6)
Implement the WizardProgressIndicator Flutter widget displaying current step position within the ≤5 step constraint. Show numbered step dots with completed/active/upcoming states, accessible semantic labels for screen readers (e.g., 'Step 2 of 4, Date selection'), and a step title below the indicator. Widget must reject configurations with more than 5 steps by asserting in debug mode via the CognitiveLoadRuleEngine. epic-cognitive-accessibility-foundation-task-008 Implement the LabelledNavigationBar Flutter widget as a WCAG 2.2 AA-compliant bottom navigation bar. Each tab must display both an icon and a visible text label (no icon-only tabs). Enforce a maximum of 5 tabs. Implement full semantics labels, selected-state announcements for screen readers, minimum 48dp touch targets per design token enforcer rules, and support for org-specific label overrides via the labels provider. epic-cognitive-accessibility-foundation-task-009 Implement the PlainLanguageErrorDisplay Flutter widget that renders error messages from the ErrorMessageRegistry via the PlainLanguageContentService. Displays a short plain-language message, a one-sentence actionable instruction, and an optional 'Get help' link. Integrates with the live region announcer for screen reader announcements. Replaces all raw error code displays throughout the app. Styled using accessibility design tokens for contrast compliance. epic-cognitive-accessibility-foundation-task-013 Implement the InlineContextualHelpWidget Flutter widget that displays context-sensitive help text from the HelpContentRegistry. Renders as a small info icon that expands inline (not a modal) to show ≤80-word plain-language explanation. Fully accessible with semantic labels, keyboard focus management, and screen reader announcements. Help content is resolved via PlainLanguageContentService with org-specific terminology overrides applied automatically. epic-cognitive-accessibility-foundation-task-014 Implement the ConfirmBeforeSubmitScreen using SingleActionScreenLayout as the base. Displays a structured summary of all wizard answers with clearly labelled fields, a single primary 'Submit' CTA, and a secondary 'Go back' action. Integrates with WizardStateManager to read current draft state and WizardProgressIndicator to show final step position. All field labels use plain-language text from PlainLanguageContentService. epic-cognitive-accessibility-foundation-task-015 Implement the SingleActionScreenLayout Flutter widget that enforces the one-primary-action-per-screen cognitive accessibility constraint. The layout provides a scrollable content area, a fixed bottom action zone with exactly one primary CTA and an optional secondary action, a back button (not swipe), and a page title. The layout integrates with CognitiveLoadRuleEngine to assert ≤3 choices in content area and refuses to render if more than one primary action is passed. epic-cognitive-accessibility-foundation-task-010
Epic Risks (4)
high impact medium prob technical

The error message registry and help content registry both depend on bundled JSON assets loaded at startup. If asset loading fails silently (e.g. malformed JSON, missing pubspec asset declaration), the entire plain-language layer falls back to empty strings or raw error codes, breaking the accessibility guarantee app-wide.

Mitigation & Contingency

Mitigation: Implement eager validation of both assets during app initialisation with an assertion failure in debug mode and a structured error log in release mode. Add integration tests that verify asset loading in the Flutter test harness on every CI run.

Contingency: Ship a hardcoded minimum-viable fallback message set directly in Dart code so the app always has at least a safe generic message, preventing a blank or code-only error surface.

medium impact medium prob dependency

The AccessibilityDesignTokenEnforcer relies on dart_code_metrics custom lint rules. If the lint toolchain is not already configured in the project's CI pipeline, integrating a new linting plugin may cause unexpected build failures or require significant CI configuration work beyond the estimated scope.

Mitigation & Contingency

Mitigation: Audit the existing dart_code_metrics configuration in the project before starting implementation. Scope the lint rules to a separate Dart package that can be integrated incrementally, starting with the most critical rule (hard-coded colors) and adding others in subsequent iterations.

Contingency: Fall back to Flutter test-level assertions (using the cognitive-accessibility-audit utility) to catch violations in CI if the lint plugin integration is delayed, preserving enforcement coverage without blocking the epic.

medium impact low prob technical

WizardDraftRepository must choose between shared_preferences and Hive for local persistence. Choosing the wrong store for the data volume (e.g. shared_preferences for complex nested wizard state) can lead to serialisation bugs or performance degradation, particularly on lower-end Android devices used by some NHF members.

Mitigation & Contingency

Mitigation: Define a clean repository interface first and implement shared_preferences as the initial backend. Profile serialisation round-trip time with a realistic wizard state payload (≈10 fields) before committing to either store.

Contingency: Swap the persistence backend behind the repository interface without touching wizard UI code, which is possible precisely because the repository abstraction isolates the storage detail.

medium impact high prob scope

The AccessibilityDesignTokenEnforcer scope could expand significantly if a large portion of existing widgets use hard-coded values. Discovering widespread violations during this epic would force either a major refactor or a decision to exclude legacy components, potentially reducing the enforcer's coverage and value.

Mitigation & Contingency

Mitigation: Run a preliminary audit of existing widgets using a simple grep for hard-coded hex colors and raw pixel values before implementation begins. Use the results to set a realistic remediation boundary for this epic and log all out-of-scope violations as tracked tech-debt items.

Contingency: Scope the enforcer to new and modified components only (via file-path filters in dart_code_metrics config), shipping a partial but immediately valuable coverage rather than blocking the epic on full-codebase remediation.