fix(tui): PermissionsScreen diff mode cycle uses split/auto per spec #1449

Updated step definitions to match the corrected enum values (SPLIT and AUTO instead of SIDE_BY_SIDE and CONTEXT) and updated method names (split_diff instead of side_by_side_diff).

ISSUES CLOSED: #1449
This commit is contained in:
2026-04-27 10:23:07 +00:00
committed by Forgejo
parent 4f74acd158
commit 9f4f4e063e
+10 -10
View File
@@ -65,13 +65,13 @@ def step_inspect_diff_display_mode(context):
context._diff_display_mode = DiffDisplayMode
@then('DiffDisplayMode should have values "unified", "side_by_side", "context"')
@then('DiffDisplayMode should have values "unified", "split", "auto"')
def step_diff_display_mode_values(context):
from cleveragents.tui.permissions.models import DiffDisplayMode
assert DiffDisplayMode.UNIFIED == "unified"
assert DiffDisplayMode.SIDE_BY_SIDE == "side_by_side"
assert DiffDisplayMode.CONTEXT == "context"
assert DiffDisplayMode.SPLIT == "split"
assert DiffDisplayMode.AUTO == "auto"
# ---------------------------------------------------------------------------
@@ -165,13 +165,13 @@ def step_rendered_diff_empty(context):
)
@when("I call side_by_side_diff on the request")
@when("I call split_diff on the request")
def step_call_side_by_side_diff(context):
context._sbs_left, context._sbs_right = context._perm_request.side_by_side_diff()
context._sbs_left, context._sbs_right = context._perm_request.split_diff()
@then("both sides should have the same number of lines")
def step_sbs_same_length(context):
def step_split_same_length(context):
assert len(context._sbs_left) == len(context._sbs_right), (
f"Left: {len(context._sbs_left)}, Right: {len(context._sbs_right)}"
)
@@ -578,13 +578,13 @@ def step_create_insert_only_request(context):
@then("the left side should have non-empty lines")
def step_left_side_non_empty(context):
left, _ = context._perm_request.side_by_side_diff()
left, _ = context._perm_request.split_diff()
assert any(line.strip() for line in left), f"Expected non-empty left lines: {left}"
@then("the right side should have empty lines for deleted content")
def step_right_side_empty_for_deleted(context):
_, right = context._perm_request.side_by_side_diff()
_, right = context._perm_request.split_diff()
# For delete-only, right side should have empty strings
assert any(line == "" for line in right), (
f"Expected empty right lines for deleted content: {right}"
@@ -593,7 +593,7 @@ def step_right_side_empty_for_deleted(context):
@then("the right side should have non-empty lines")
def step_right_side_non_empty(context):
_, right = context._perm_request.side_by_side_diff()
_, right = context._perm_request.split_diff()
assert any(line.strip() for line in right), (
f"Expected non-empty right lines: {right}"
)
@@ -601,7 +601,7 @@ def step_right_side_non_empty(context):
@then("the left side should have empty lines for inserted content")
def step_left_side_empty_for_inserted(context):
left, _ = context._perm_request.side_by_side_diff()
left, _ = context._perm_request.split_diff()
# For insert-only, left side should have empty strings
assert any(line == "" for line in left), (
f"Expected empty left lines for inserted content: {left}"