Skip to content

Expand Flutter test coverage to include chat flow, approval flow, and settings #72

Description

@neooriginal

This issue is AI generated.

Problem

The Flutter test suite currently has 6 test files:

  • test/flutter/unit/backend_client_test.dart
  • test/flutter/unit/mcp_server_item_test.dart
  • test/flutter/unit/password_strength_test.dart
  • test/flutter/unit/task_item_test.dart
  • test/flutter/widget/auth_form_test.dart
  • test/flutter/widget/splash_view_test.dart

The following critical user flows have zero test coverage:

  • Sending a chat message and streaming the response
  • The tool approval flow (approval request arrives → sheet shown → user decides → result sent)
  • Settings save/discard lifecycle
  • Navigation between panels
  • WebSocket connect/disconnect/reconnect state transitions

This makes refactoring of main_controller.dart and the panel widgets risky and regressions hard to catch.

Required change

Add widget and unit tests for at minimum:

  • ChatPanel: send message, streaming message display, tool event items appearing, scroll-to-bottom behaviour.
  • SecurityPanel + _ToolApprovalSheet: approval request received, approve/deny, submission error handling, concurrent approval queuing.
  • SettingsPanel: settings load, save, unsaved-changes guard.
  • NeoAgentController: WebSocket state transitions, pendingApproval queue management.

Acceptance criteria

  • Test files exist for each of the listed panels and flows.
  • Coverage includes the happy path and at least one error/edge case per flow.
  • All new tests pass in CI (npm run flutter:test).

Metadata

Metadata

Assignees

No one assigned

    Labels

    autonomousGenerated by AIenhancementNew feature or requestpriority: lowNice to have — refactoring, minor UX, or future featurestestingTest coverage or test infrastructure work

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions