conductor(checkpoint): Checkpoint end of Phase 3
This commit is contained in:
@@ -27,8 +27,8 @@ def app_instance():
|
||||
"active": "main",
|
||||
"discussions": {
|
||||
"main": {"history": []},
|
||||
"take_1": {"history": []},
|
||||
"take_2": {"history": []}
|
||||
"main_take_1": {"history": []},
|
||||
"main_take_2": {"history": []}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,6 +50,7 @@ def test_render_discussion_tabs(app_instance):
|
||||
mock_imgui.checkbox.return_value = (False, False)
|
||||
mock_imgui.begin_child.return_value = True
|
||||
mock_imgui.selectable.return_value = (False, False)
|
||||
mock_imgui.ListClipper.return_value.step.return_value = False
|
||||
|
||||
# Mock tab bar calls
|
||||
mock_imgui.begin_tab_bar.return_value = True
|
||||
@@ -58,13 +59,12 @@ def test_render_discussion_tabs(app_instance):
|
||||
app_instance._render_discussion_panel()
|
||||
|
||||
# Check if begin_tab_bar was called
|
||||
# This SHOULD fail if it's not implemented yet
|
||||
mock_imgui.begin_tab_bar.assert_called_with("##discussion_tabs")
|
||||
mock_imgui.begin_tab_bar.assert_called_with("discussion_takes_tabs")
|
||||
|
||||
# Check if begin_tab_item was called for each discussion
|
||||
names = sorted(["main", "take_1", "take_2"])
|
||||
for name in names:
|
||||
mock_imgui.begin_tab_item.assert_any_call(name)
|
||||
names = [("Original###main", None, mock_imgui.TabItemFlags_.set_selected), ("Take 1###main_take_1", None, 0), ("Take 2###main_take_2", None, 0)]
|
||||
for args in names:
|
||||
mock_imgui.begin_tab_item.assert_any_call(*args)
|
||||
|
||||
def test_switching_discussion_via_tabs(app_instance):
|
||||
"""Verify that clicking a tab switches the discussion."""
|
||||
@@ -79,12 +79,13 @@ def test_switching_discussion_via_tabs(app_instance):
|
||||
mock_imgui.checkbox.return_value = (False, False)
|
||||
mock_imgui.begin_child.return_value = True
|
||||
mock_imgui.selectable.return_value = (False, False)
|
||||
mock_imgui.ListClipper.return_value.step.return_value = False
|
||||
|
||||
mock_imgui.begin_tab_bar.return_value = True
|
||||
|
||||
# Simulate 'take_1' being active/selected
|
||||
def side_effect(name, flags=None):
|
||||
if name == "take_1":
|
||||
def side_effect(name, p_open=None, flags=None):
|
||||
if name == "Take 1###main_take_1":
|
||||
return (True, True)
|
||||
return (False, True)
|
||||
|
||||
@@ -93,4 +94,4 @@ def test_switching_discussion_via_tabs(app_instance):
|
||||
app_instance._render_discussion_panel()
|
||||
|
||||
# If implemented with tabs, this should be called
|
||||
mock_switch.assert_called_with("take_1")
|
||||
mock_switch.assert_called_with("main_take_1")
|
||||
|
||||
Reference in New Issue
Block a user