fix: ::hilfe zeigt ::onboarding Subcommands einzeln mit Beschreibung
This commit is contained in:
@@ -732,6 +732,60 @@ class TestSectionedHelpText:
|
||||
text = build_help_text(registry)
|
||||
assert "Rocket.Chat-Plugin direkt" in text
|
||||
|
||||
def test_help_text_renders_subcommands(self):
|
||||
"""Befehle mit subcommands werden mit eingerückten Unterpunkten gerendert."""
|
||||
from archivar.inline_commands import InlineCommandRegistry, build_help_text
|
||||
|
||||
registry = InlineCommandRegistry()
|
||||
async def dummy(room_id, args):
|
||||
return "ok"
|
||||
|
||||
registry.register(
|
||||
"onboarding", dummy,
|
||||
help_text="Onboarding steuern",
|
||||
category="Plugin",
|
||||
subcommands={
|
||||
"start": "Startet das Onboarding neu",
|
||||
"status": "Zeigt den aktuellen Onboarding-Status",
|
||||
"resume": "Setzt ein pausiertes Onboarding fort",
|
||||
"pause": "Pausiert das Onboarding",
|
||||
"abort": "Bricht das Onboarding ab",
|
||||
"reset": "Hart-Reset des Onboarding-State",
|
||||
},
|
||||
)
|
||||
|
||||
text = build_help_text(registry)
|
||||
assert "::onboarding" in text
|
||||
assert "::onboarding start" in text
|
||||
assert "::onboarding status" in text
|
||||
assert "::onboarding resume" in text
|
||||
assert "::onboarding pause" in text
|
||||
assert "::onboarding abort" in text
|
||||
assert "::onboarding reset" in text
|
||||
assert "Startet das Onboarding neu" in text
|
||||
assert "Zeigt den aktuellen Onboarding-Status" in text
|
||||
assert "Setzt ein pausiertes Onboarding fort" in text
|
||||
assert "Pausiert das Onboarding" in text
|
||||
assert "Bricht das Onboarding ab" in text
|
||||
assert "Hart-Reset des Onboarding-State" in text
|
||||
|
||||
def test_help_text_command_without_subcommands_no_indent(self):
|
||||
"""Befehle ohne subcommands haben keine eingerückten Unterpunkte."""
|
||||
from archivar.inline_commands import InlineCommandRegistry, build_help_text
|
||||
|
||||
registry = InlineCommandRegistry()
|
||||
async def dummy(room_id, args):
|
||||
return "ok"
|
||||
|
||||
registry.register("multiroom", dummy, "Multi-Room", category="Plugin")
|
||||
|
||||
text = build_help_text(registry)
|
||||
# Sollte keine eingerückten Zeilen haben (keine subcommands)
|
||||
lines = text.split("\n")
|
||||
for line in lines:
|
||||
if "multiroom" in line:
|
||||
assert not line.startswith(" -"), f"Unexpected indent: {line}"
|
||||
|
||||
|
||||
# ── R5.1: Registry mit neuen Befehlen ────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user