fix(tui): add no-@token edge case scenario to TDD regression suite
Adds a 5th scenario to tdd_tui_suggestions_query_extraction_4741.feature that verifies suggestions() is NOT called when the prompt contains no @token. This covers the guard condition in on_input_submitted and completes the regression test suite for issue #4741.
This commit is contained in:
@@ -267,3 +267,13 @@ def step_assert_suggestions_query_4741(
|
||||
f" Got: '{actual}'\n"
|
||||
f" (The buggy value would have been: '{wrong}')"
|
||||
)
|
||||
|
||||
|
||||
@then("suggestions was not called for issue 4741")
|
||||
def step_assert_suggestions_not_called_4741(context: object) -> None:
|
||||
"""Assert that suggestions() was not called (no @token in prompt)."""
|
||||
actual = context._tui4741_captured_query
|
||||
assert actual is None, (
|
||||
f"suggestions() was unexpectedly called with query: '{actual}'. "
|
||||
f"Expected it not to be called when no @token is present in the prompt."
|
||||
)
|
||||
|
||||
@@ -40,3 +40,11 @@ Feature: TDD: suggestions() query extraction in on_input_submitted uses correct
|
||||
And I call on_mount on the app for issue 4741
|
||||
And I submit "@actor:local/dev" to the app for issue 4741 and capture the suggestions query
|
||||
Then the suggestions query should be "actor:local/dev" not "@actor:local/dev"
|
||||
|
||||
@tdd_issue @tdd_issue_4741
|
||||
Scenario: Prompt with no @token does not call suggestions
|
||||
Given a mock command router and persona state for issue 4741
|
||||
When I instantiate the TUI app for issue 4741
|
||||
And I call on_mount on the app for issue 4741
|
||||
And I submit "analyse the codebase" to the app for issue 4741 and capture the suggestions query
|
||||
Then suggestions was not called for issue 4741
|
||||
|
||||
Reference in New Issue
Block a user