fix(cli): add spec-required 'Profile Removed' panel to agents automation-profile remove rich output #3293
@@ -167,7 +167,17 @@ Feature: Automation Profile CLI commands
|
||||
Given a custom profile "acme/strict" has been added
|
||||
When I run automation-profile remove "acme/strict" with --yes
|
||||
Then the automation-profile remove should succeed
|
||||
And the automation-profile output should contain "removed"
|
||||
And the automation-profile output should contain "Profile Removed"
|
||||
And the automation-profile output should contain "Name:"
|
||||
And the automation-profile output should contain "OK"
|
||||
|
||||
Scenario: Remove custom profile shows Profile Removed panel
|
||||
Given a custom profile "acme/panel-test" has been added
|
||||
When I run automation-profile remove "acme/panel-test" with --yes
|
||||
Then the automation-profile remove should succeed
|
||||
And the automation-profile output should contain "Profile Removed"
|
||||
And the automation-profile output should contain "acme/panel-test"
|
||||
And the automation-profile output should contain "OK"
|
||||
|
||||
Scenario: Remove built-in profile fails
|
||||
When I run automation-profile remove "manual" with --yes
|
||||
|
||||
@@ -213,7 +213,7 @@ def test_list_json() -> None:
|
||||
|
||||
|
||||
def test_remove_profile() -> None:
|
||||
"""Test removing a custom profile."""
|
||||
"""Test removing a custom profile - verifies Profile Removed panel is rendered."""
|
||||
_reset_service()
|
||||
# First add a profile
|
||||
fd, path = tempfile.mkstemp(suffix=".yaml")
|
||||
@@ -228,7 +228,16 @@ def test_remove_profile() -> None:
|
||||
# Then remove it (reuse same service so the profile persists)
|
||||
result = _invoke(["remove", "acme/robot-test", "--yes"])
|
||||
assert result.exit_code == 0, f"remove failed: {result.output}"
|
||||
assert "removed" in result.output.lower()
|
||||
# Verify the spec-required Profile Removed panel is rendered
|
||||
assert "Profile Removed" in result.output, (
|
||||
f"Expected 'Profile Removed' panel in output. Got: {result.output}"
|
||||
)
|
||||
assert "acme/robot-test" in result.output, (
|
||||
f"Expected profile name in panel output. Got: {result.output}"
|
||||
)
|
||||
assert "OK" in result.output, (
|
||||
f"Expected 'OK' success message in output. Got: {result.output}"
|
||||
)
|
||||
print("remove-profile-ok")
|
||||
|
||||
|
||||
|
||||
@@ -308,7 +308,9 @@ def remove_profile(
|
||||
console.print(format_output(data, fmt))
|
||||
return
|
||||
|
||||
console.print(f"[green]✓[/green] Automation profile removed: {name}")
|
||||
panel = Panel(f"[bold cyan]Name:[/bold cyan] {name}", title="Profile Removed")
|
||||
console.print(panel)
|
||||
console.print("[green]✓ OK[/green] Profile removed")
|
||||
|
||||
except NotFoundError as exc:
|
||||
console.print(f"[red]Profile not found:[/red] '{name}'")
|
||||
|
||||
Reference in New Issue
Block a user