From f20b7ea593ab8e3198d858cde520bd8756bc3ad1 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Tue, 1 Apr 2025 16:51:23 +0200 Subject: [PATCH] Add test demonstrating problem with main view display when pressing `e` in a stack of branches We keep the same commit selected (even though its index changed because of the added update-ref todo), which is nice; however, the main view shows the diff of the wrong commit, which is very confusing. I'm suprised that this hasn't been noticed yet. The reason why this happens is that we first do the refresh, which includes re-rendering the main view diff (with the same commit index as before, so the wrong one), and then we restore the correct commit index but don't render the main view again. --- .../interactive_rebase/drop_todo_commit_with_update_ref.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref.go b/pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref.go index 02efec9da..8eff10632 100644 --- a/pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref.go +++ b/pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref.go @@ -48,6 +48,12 @@ var DropTodoCommitWithUpdateRef = NewIntegrationTest(NewIntegrationTestArgs{ Contains("<-- YOU ARE HERE --- commit 02").IsSelected(), Contains("CI commit 01"), ). + Tap(func() { + /* EXPECTED: + t.Views().Main().Content(Contains("commit 02")) + ACTUAL: */ + t.Views().Main().Content(Contains("commit 03")) + }). NavigateToLine(Contains("commit 06")). Press(keys.Universal.Remove)