Files
cleveragents-core/features/tui_slash_command_overlay_coverage.feature
freemo 051ee7c290 test(coverage): add Behave BDD tests to improve coverage across 52 source files
Added 52 new .feature files and corresponding _steps.py files targeting
previously uncovered code paths in the following areas:

- TUI layer: app, commands, persona (state/schema/registry), widgets,
  input (shell_exec, reference_parser)
- Application services: plan lifecycle/service/executor, session,
  project, repo indexing, correction, checkpoint, actor, llm_actors,
  strategy coordinator, resource file watcher, service retry wiring
- CLI commands: session, resource, repl, plan, db, automation_profile
- Domain models: retry_policy, resource_type, cost_budget,
  docker_compose_analyzer, detail_level, _sql_string_aware,
  _postgresql_helpers
- Core: circuit_breaker, retry_service_patterns
- Infrastructure: repositories, transaction_sandbox, strategy_registry,
  plugins/loader, container
- Config: settings
- Agents: plan_generation, context_analysis, auto_debug
- A2A: facade

All new tests follow the Behave/Gherkin BDD standard. Resolved step
definition collisions with unique prefixes. Fixed Alembic fileConfig
logger disabling issue (disable_existing_loggers=False).

ISSUES CLOSED: #1068
2026-03-20 21:22:10 +00:00

50 lines
2.3 KiB
Gherkin

Feature: TUI Slash Command Overlay Coverage
Scenarios exercising uncovered lines in slash_command_overlay.py,
including the FallbackStatic init/update and the set_commands method.
Background:
Given the slash command overlay module is imported
Scenario: Instantiating SlashCommandOverlay initialises internal text
When I create a SlashCommandOverlay instance
Then the overlay internal text should be empty
Scenario: Calling update on the overlay sets internal text
Given I have a SlashCommandOverlay instance
When I call update with "hello world"
Then the overlay internal text should be "hello world"
Scenario: set_commands filters matching commands when query is provided
Given I have a SlashCommandOverlay instance
When I call set_commands with query "he" and commands "help,history,hello,quit"
Then the overlay text should contain "/he"
And the overlay text should contain " /help"
And the overlay text should contain " /hello"
And the overlay text should not contain " /history"
And the overlay text should not contain " /quit"
Scenario: set_commands returns all commands when query is empty
Given I have a SlashCommandOverlay instance
When I call set_commands with empty query and commands "help,history,quit"
Then the overlay text should contain "/"
And the overlay text should contain " /help"
And the overlay text should contain " /history"
And the overlay text should contain " /quit"
Scenario: set_commands shows no-commands message when nothing matches
Given I have a SlashCommandOverlay instance
When I call set_commands with query "zzz" and commands "help,history,quit"
Then the overlay text should contain "/zzz"
And the overlay text should contain " (no commands)"
Scenario: set_commands truncates to at most twelve command entries
Given I have a SlashCommandOverlay instance
When I call set_commands with query "" and 15 commands prefixed with "cmd"
Then the overlay text should have exactly 13 lines
And the overlay text should not contain " /cmd13"
Scenario: FallbackStatic class is returned when textual import fails
When I force the fallback static base to load
Then the fallback class should be usable as a standalone object
And calling update on the fallback instance should store the text