test(01-06): add failing matrix command-only regressions

- Assert skills text no longer includes reaction-era labels
- Require converter to drop reaction callback support
- Lock !settings dashboard to read-only snapshot copy
This commit is contained in:
Mikhail Putilovskij 2026-04-03 12:32:21 +03:00
parent 80800be60c
commit 974935c880
3 changed files with 12 additions and 28 deletions

View file

@ -2,7 +2,8 @@ from __future__ import annotations
from types import SimpleNamespace
from adapter.matrix.converter import from_command, from_reaction, from_room_event
import adapter.matrix.converter as converter
from adapter.matrix.converter import from_command, from_room_event
from core.protocol import IncomingCallback, IncomingCommand, IncomingMessage
@ -36,15 +37,6 @@ def image_event(url: str = "mxc://x/img", mime: str = "image/jpeg"):
)
def reaction_event(key: str, relates_to: str = "$orig"):
return SimpleNamespace(
sender="@a:m.org",
event_id="$r1",
key=key,
content={"m.relates_to": {"key": key, "event_id": relates_to}},
)
async def test_plain_text_to_incoming_message():
result = from_room_event(text_event("Hello"), room_id="!r:m.org", chat_id="C1")
assert isinstance(result, IncomingMessage)
@ -100,14 +92,5 @@ async def test_image_attachment():
assert result.attachments[0].mime_type == "image/jpeg"
async def test_reaction_confirm():
result = from_reaction(reaction_event("👍"), sender="@a:m.org", chat_id="C1")
assert isinstance(result, IncomingCallback)
assert result.action == "confirm"
async def test_reaction_toggle_skill():
result = from_reaction(reaction_event("2"), sender="@a:m.org", chat_id="C1")
assert isinstance(result, IncomingCallback)
assert result.action == "toggle_skill"
assert result.payload["skill_index"] == 2
def test_converter_module_does_not_expose_reaction_callbacks():
assert not hasattr(converter, "from_reaction")