high priority medium complexity testing pending testing specialist Tier 4

Acceptance Criteria

BulkApprovalBar widget test: bar is not in widget tree when selectedCount == 0
BulkApprovalBar widget test: bar is in widget tree when selectedCount > 0
BulkApprovalBar widget test: 'Approve All' and 'Reject All' buttons have onPressed == null (disabled) when isProcessing == true
BulkApprovalBar widget test: count badge displays correct selectedCount integer value
ApprovalActionSheet widget test: tapping Reject and leaving comment empty shows inline error text widget
ApprovalActionSheet widget test: tapping Reject with valid comment and confirming transitions to confirmation step (step 2 widgets visible)
ApprovalActionSheet widget test: confirmation step displays rejection comment text
ApprovalActionSheet widget test: Semantics widget wrapping the sheet has a meaningful label for screen reader context
ApprovalActionSheet widget test: approve and reject buttons each have a Semantics label matching their function (WCAG 2.2 AA — name, role, value)
Integration test: open ApprovalActionSheet for a real test claim, tap Approve, confirm, verify sheet closes and parent list reflects updated claim status via Supabase test environment

Technical Requirements

frameworks
Flutter
BLoC
flutter_test
apis
Supabase PostgreSQL 15
data models
claim_event
activity
performance requirements
Widget tests must complete in under 5 seconds total
Integration test must complete within 30 seconds including Supabase round-trip
security requirements
Integration test must use a dedicated test Supabase project or local emulator — never production environment
Test credentials must be loaded from environment variables, not hardcoded in test files
ui components
BulkApprovalBar (widget under test)
ApprovalActionSheet (widget under test)
MockApprovalWorkflowBloc for widget tests
Real ApprovalWorkflowBloc + Supabase test client for integration test

Execution Context

Execution Tier
Tier 4

Tier 4 - 323 tasks

Can start after Tier 3 completes

Implementation Notes

Structure the test file in three groups: 'BulkApprovalBar widget tests', 'ApprovalActionSheet widget tests', 'Approval integration tests'. For WCAG 2.2 AA semantics testing: every interactive element needs a Semantics label — use Semantics(label: 'Approve claim ${claim.id}', button: true, child: ...) pattern on action buttons. The integration test should use the integration_test package (not flutter_driver which is legacy). Wrap integration test main() with IntegrationTestWidgetsFlutterBinding.ensureInitialized().

For Supabase test environment isolation: use a separate test organization ID seeded in migrations. Keep the integration test in a separate file (integration_test/ directory) from widget tests (test/ directory) per Flutter conventions. BulkApprovalBar visibility should be tested with AnimatedSwitcher or Visibility — find the widget via find.byType(BulkApprovalBar).evaluate().isNotEmpty.

Testing Requirements

Widget tests: use flutter_test WidgetTester with BlocProvider wrapping MockBloc (mocktail). Use tester.tap(find.byType(ElevatedButton)) and pumpAndSettle. For semantics tests, use tester.getSemantics(find.byType(AppButton)) and verify SemanticsData.label is non-empty and meaningful. For WCAG: use flutter_test's SemanticsHandle (tester.ensureSemantics()) before semantic assertions.

Integration test: use flutter_driver or integration_test package. Seed test data in Supabase test environment in setUp, clean up in tearDown. Verify claim status change via Supabase client query after sheet closes.

Component
Approval Action Bottom Sheet
ui medium
Epic Risks (2)
medium impact medium prob scope

If a bulk approval batch partially fails (some claims approved, some failed), the UI must communicate which specific claims failed without overwhelming the coordinator. A poorly designed error display could cause coordinators to re-approve already-approved claims or miss claims that still need attention.

Mitigation & Contingency

Mitigation: Design the BulkApprovalResult display to show a clear summary (e.g., '14 approved, 2 failed') with a collapsible list of failed claims including their IDs and submitter names. Failed claims should remain selected in the queue so the coordinator can retry them individually.

Contingency: If the summary UI proves insufficient, add a dedicated 'bulk action history' sheet showing the last bulk operation result, accessible from the queue screen header.

medium impact low prob technical

If the app is backgrounded or the network drops while the coordinator has the ApprovalActionSheet open mid-decision, the typed comment could be lost and the transition state could be ambiguous, potentially causing a coordinator to believe they approved a claim that was never submitted.

Mitigation & Contingency

Mitigation: Persist the in-progress action sheet state (selected action + comment text) to a local draft store keyed on claim ID. On sheet re-open for the same claim, restore the draft. After confirmed submission, verify the resulting claim status from the server before dismissing the sheet.

Contingency: On network error during submission, display a persistent retry banner within the sheet rather than dismissing it, so the coordinator can resubmit without re-entering their comment.