conductor(checkpoint): Checkpoint end of Phase 4 - UI Features & History List

This commit is contained in:
2026-05-05 17:50:55 -04:00
parent b3c28a0697
commit 446a58717e
3 changed files with 78 additions and 0 deletions
+18
View File
@@ -73,3 +73,21 @@ def test_redo_cleared_on_push():
assert hm.can_redo is True
hm.push("S2", "D2")
assert hm.can_redo is False
def test_jump_to_undo():
hm = HistoryManager(max_capacity=10)
hm.push("S0", "D0")
hm.push("S1", "D1")
hm.push("S2", "D2")
hm.push("S3", "D3")
# Current state is S4
# Jump to S1 (index 1)
entry = hm.jump_to_undo(1, "S4", "Before Jump")
assert entry.state == "S1"
assert hm.can_undo is True # S0 is still there
assert len(hm._undo_stack) == 1
assert hm.can_redo is True
# Redo stack should have [S4, S3, S2]
assert len(hm._redo_stack) == 3
assert hm._redo_stack[-1].state == "S2"