feat: frontend turn_html_replace SSE handler for regenerate live-swap (T86)
This commit is contained in:
@@ -104,10 +104,16 @@ def test_read_recent_dialogue_returns_chronological_pairs(tmp_path):
|
||||
with open_db(db) as conn:
|
||||
out = read_recent_dialogue(conn, "chat_a", limit=10)
|
||||
|
||||
assert out == [
|
||||
{"speaker": "you", "text": "hello"},
|
||||
{"speaker": "bot_a", "text": "Original."},
|
||||
# Each entry now carries the source ``event_log.id`` as ``event_id``
|
||||
# (T86 follow-up) so the chat-detail Jinja loop can stamp
|
||||
# ``id="turn-<n>"`` on each rendered turn DIV — needed by the
|
||||
# ``turn_html_replace`` SSE handler for in-place regenerate swaps.
|
||||
speakers = [(e["speaker"], e["text"]) for e in out]
|
||||
assert speakers == [
|
||||
("you", "hello"),
|
||||
("bot_a", "Original."),
|
||||
]
|
||||
assert all("event_id" in e and isinstance(e["event_id"], int) for e in out)
|
||||
|
||||
|
||||
def test_read_recent_dialogue_filters_superseded_and_other_chats(tmp_path):
|
||||
|
||||
Reference in New Issue
Block a user