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.
This commit is contained in:
Stefan Haller 2025-04-01 16:51:23 +02:00
parent 14187c9d15
commit f20b7ea593

View file

@ -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)