forked from HAL9000/cleveragents-core
0f9ca00ce7
Update SlashCommandOverlay.set_commands() to accept list[SlashCommandSpec] instead of list[str], and render each entry as aligned columns: /command-name Description text Changes: - slash_command_overlay.py: update set_commands() signature to accept list[SlashCommandSpec]; render name + description with aligned padding using _COMMAND_COL_WIDTH = 28 characters for the name column - slash_catalog.py: add slash_command_specs() helper returning all specs - app.py: switch on_mount() to call slash_command_specs() instead of slash_command_names() so full spec objects are passed to the overlay - features/tui_slash_command_overlay_coverage.feature: add scenario verifying description rendering; update existing scenarios to use SlashCommandSpec objects via _make_specs() helper - features/steps/tui_slash_command_overlay_coverage_steps.py: update step implementations to build SlashCommandSpec objects from CSV names - features/tui_slash_overlay_descriptions.feature: new feature file with BDD scenarios covering description rendering and @tdd_expected_fail capture of the pre-fix name-only behaviour - features/steps/tui_slash_overlay_descriptions_steps.py: step defs for the new feature file - robot/tui_smoke.robot: add Slash Command Overlay Renders Descriptions integration test verifying descriptions appear in rendered overlay ISSUES CLOSED: #3437
58 lines
2.8 KiB
Gherkin
58 lines
2.8 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
|
|
|
|
Scenario: set_commands renders descriptions alongside command names
|
|
Given I have a SlashCommandOverlay instance
|
|
When I call set_commands with query "" and commands "session:create,session:list"
|
|
Then the overlay text should contain " /session:create"
|
|
And the overlay text should contain "Desc for session:create"
|
|
And the overlay text should contain " /session:list"
|
|
And the overlay text should contain "Desc for session:list"
|