Files
cleveragents-core/features/tdd_slash_overlay_keyboard_nav.feature
T
HAL9000 a74c495a1f test(tui): add BDD keyboard navigation for SlashCommandOverlay (#10442)
Implements keyboard navigation support for SlashCommandOverlay:
- navigate_up(): move selection up, clamped to index 0
- navigate_down(): move selection down, clamped to last command
- select_current(): return the currently highlighted SlashCommandSpec
- dismiss(): clear overlay and reset state (Escape key action)
- selected_index: tracks current highlighted position

Adds BDD feature file and step definitions covering all navigation
scenarios including boundary conditions (clamp at 0 and max index).

Closes #10442
2026-04-23 18:29:11 +00:00

61 lines
2.4 KiB
Gherkin

@tdd_issue @tdd_issue_10442
Feature: TDD Issue #10442 — SlashCommandOverlay keyboard navigation
As a developer
I want to verify that SlashCommandOverlay supports keyboard navigation
So that users can navigate the slash command list with up/down/Enter/Escape
Background:
Given the slash command overlay module is imported
Scenario: SlashCommandOverlay has navigate_up method
Given I have a SlashCommandOverlay instance
Then the overlay should have a navigate_up method
Scenario: SlashCommandOverlay has navigate_down method
Given I have a SlashCommandOverlay instance
Then the overlay should have a navigate_down method
Scenario: SlashCommandOverlay has select_current method
Given I have a SlashCommandOverlay instance
Then the overlay should have a select_current method
Scenario: SlashCommandOverlay has dismiss method
Given I have a SlashCommandOverlay instance
Then the overlay should have a dismiss method
Scenario: SlashCommandOverlay has selected_index attribute
Given I have a SlashCommandOverlay instance
Then the overlay should have a selected_index attribute
Scenario: navigate_down increments selected_index
Given I have a SlashCommandOverlay instance
And the overlay has commands loaded
When I call navigate_down on the overlay
Then the overlay selected_index should be 1
Scenario: navigate_up decrements selected_index
Given I have a SlashCommandOverlay instance
And the overlay has commands loaded
And the overlay selected_index is set to 2
When I call navigate_up on the overlay
Then the overlay selected_index should be 1
Scenario: navigate_up does not go below zero
Given I have a SlashCommandOverlay instance
And the overlay has commands loaded
When I call navigate_up on the overlay
Then the overlay selected_index should be 0
Scenario: navigate_down does not exceed command count
Given I have a SlashCommandOverlay instance
And the overlay has commands loaded
When I call navigate_down on the overlay many times
Then the overlay selected_index should not exceed the command count
Scenario: select_current returns the currently selected command
Given I have a SlashCommandOverlay instance
And the overlay has commands loaded
And the overlay selected_index is set to 1
When I call select_current on the overlay
Then the selected command should be the second command in the list