Files
temp/features/steps/tui_help_panel_overlay_coverage_steps.py
freemo 66ac33b185 fix(tui): synchronize HelpPanelOverlay keybinding display with actual app BINDINGS
- Replace ctrl+tab with ctrl+t for preset cycling in _CONTEXT_ITEMS Main Screen
  context, matching the actual BINDINGS registered in app.py
- Remove the tab/Cycle to next persona entry from Main Screen context since
  no such binding exists in app.BINDINGS (tracked separately in #3338)
- Add Behave BDD scenarios asserting that help panel keybindings match the
  actual registered BINDINGS: ctrl+t present, ctrl+tab absent, no stale tab
  entry for persona cycling
- Add step definition for 'should not contain' assertion to support the new
  negative-assertion scenarios

Resolves the double-inconsistency where users following the help panel
instructions (ctrl+tab) would press the wrong key and get no response.

ISSUES CLOSED: #3444
2026-04-05 18:09:41 +00:00

66 lines
2.0 KiB
Python

"""Step definitions for tui_help_panel_overlay_coverage.feature."""
from __future__ import annotations
from behave import given, then, when
from cleveragents.tui.widgets.help_panel_overlay import (
HelpPanelOverlay,
resolve_help_context,
)
@when("I resolve help context for an empty prompt")
def step_resolve_help_context_empty(context):
context.resolved_help_context = resolve_help_context("")
@when('I resolve help context for prompt text "{text}"')
def step_resolve_help_context(context, text):
context.resolved_help_context = resolve_help_context(text)
@then('the resolved help context should be "{expected}"')
def step_verify_resolved_help_context(context, expected):
assert context.resolved_help_context == expected
@given("a fresh help panel overlay")
def step_fresh_help_panel_overlay(context):
context.help_panel = HelpPanelOverlay()
@when('I show help for context "{context_name}"')
def step_show_help_for_context(context, context_name):
context.help_panel.show_context(context_name)
@when('I toggle help for context "{context_name}"')
def step_toggle_help_for_context(context, context_name):
context.help_panel.toggle(context_name)
@then('the standalone help panel text should contain "{text}"')
def step_standalone_help_panel_text_contains(context, text):
assert text in context.help_panel._text, (
f"Expected {text!r} in help panel text, got:\n{context.help_panel._text}"
)
@then('the standalone help panel text should not contain "{text}"')
def step_standalone_help_panel_text_not_contains(context, text):
assert text not in context.help_panel._text, (
f"Expected {text!r} NOT in help panel text, but found it in:\n{context.help_panel._text}"
)
@then("the help panel should be visible")
def step_help_panel_visible(context):
assert context.help_panel.visible is True
@then("the help panel should be hidden")
def step_help_panel_hidden(context):
assert context.help_panel.visible is False
assert context.help_panel._text == ""