From 6417da531919ec485ee7cc46999a8a14a7b868da Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Fri, 14 Aug 2026 18:35:09 +0200 Subject: [PATCH] Add selection assertions to tests involving conflicts This doesn't change anything, we just pin down the selection behavior around conflicts; we are going to change that behavior, and these tests will make it obvious how when they change in the next commit. --- .../tests/commit/amend_when_there_are_conflicts_and_amend.go | 2 +- .../tests/commit/amend_when_there_are_conflicts_and_cancel.go | 2 +- .../tests/commit/revert_with_conflict_multiple_commits.go | 4 ++-- .../tests/commit/revert_with_conflict_single_commit.go | 2 +- pkg/integration/tests/commit/shared.go | 2 +- .../tests/interactive_rebase/amend_commit_with_conflict.go | 4 ++-- .../tests/interactive_rebase/edit_the_confl_commit.go | 2 +- .../revert_multiple_commits_in_interactive_rebase.go | 4 ++-- pkg/integration/tests/interactive_rebase/shared.go | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pkg/integration/tests/commit/amend_when_there_are_conflicts_and_amend.go b/pkg/integration/tests/commit/amend_when_there_are_conflicts_and_amend.go index 7b8bf1ca1..b563924bd 100644 --- a/pkg/integration/tests/commit/amend_when_there_are_conflicts_and_amend.go +++ b/pkg/integration/tests/commit/amend_when_there_are_conflicts_and_amend.go @@ -30,7 +30,7 @@ var AmendWhenThereAreConflictsAndAmend = NewIntegrationTest(NewIntegrationTestAr Focus(). Lines( Contains("─── Pending rebase todos"), - Contains("pick").Contains("commit three"), + Contains("pick").Contains("commit three").IsSelected(), Contains("pick").Contains("<-- CONFLICT --- file1 changed in branch"), Contains("─── Commits"), Contains("commit two"), diff --git a/pkg/integration/tests/commit/amend_when_there_are_conflicts_and_cancel.go b/pkg/integration/tests/commit/amend_when_there_are_conflicts_and_cancel.go index 91eff7d59..127945514 100644 --- a/pkg/integration/tests/commit/amend_when_there_are_conflicts_and_cancel.go +++ b/pkg/integration/tests/commit/amend_when_there_are_conflicts_and_cancel.go @@ -34,7 +34,7 @@ var AmendWhenThereAreConflictsAndCancel = NewIntegrationTest(NewIntegrationTestA Focus(). Lines( Contains("─── Pending rebase todos"), - Contains("pick").Contains("commit three"), + Contains("pick").Contains("commit three").IsSelected(), Contains("pick").Contains("<-- CONFLICT --- file1 changed in branch"), Contains("─── Commits"), Contains("commit two"), diff --git a/pkg/integration/tests/commit/revert_with_conflict_multiple_commits.go b/pkg/integration/tests/commit/revert_with_conflict_multiple_commits.go index 6e25a8496..437a7df5a 100644 --- a/pkg/integration/tests/commit/revert_with_conflict_multiple_commits.go +++ b/pkg/integration/tests/commit/revert_with_conflict_multiple_commits.go @@ -49,8 +49,8 @@ var RevertWithConflictMultipleCommits = NewIntegrationTest(NewIntegrationTestArg Contains("revert").Contains("CI <-- CONFLICT --- add first line"), Contains("─── Commits"), Contains("CI ○ add second line"), - Contains("CI ○ add first line"), - Contains("CI ○ unrelated change"), + Contains("CI ○ add first line").IsSelected(), + Contains("CI ○ unrelated change").IsSelected(), Contains("CI ○ add empty file"), ) diff --git a/pkg/integration/tests/commit/revert_with_conflict_single_commit.go b/pkg/integration/tests/commit/revert_with_conflict_single_commit.go index 57679160d..b6056a73e 100644 --- a/pkg/integration/tests/commit/revert_with_conflict_single_commit.go +++ b/pkg/integration/tests/commit/revert_with_conflict_single_commit.go @@ -43,7 +43,7 @@ var RevertWithConflictSingleCommit = NewIntegrationTest(NewIntegrationTestArgs{ Contains("revert").Contains("CI <-- CONFLICT --- add first line"), Contains("─── Commits"), Contains("CI ○ add second line"), - Contains("CI ○ add first line"), + Contains("CI ○ add first line").IsSelected(), Contains("CI ○ add empty file"), ) diff --git a/pkg/integration/tests/commit/shared.go b/pkg/integration/tests/commit/shared.go index e143eb7a0..81bf53f1e 100644 --- a/pkg/integration/tests/commit/shared.go +++ b/pkg/integration/tests/commit/shared.go @@ -44,7 +44,7 @@ func doTheRebaseForAmendTests(t *TestDriver, keys config.KeybindingConfig) { t.Views().Commits(). Lines( Contains("─── Pending rebase todos"), - Contains("pick").Contains("commit three"), + Contains("pick").Contains("commit three").IsSelected(), Contains("pick").Contains("<-- CONFLICT --- file1 changed in branch"), Contains("─── Commits"), Contains("commit two"), diff --git a/pkg/integration/tests/interactive_rebase/amend_commit_with_conflict.go b/pkg/integration/tests/interactive_rebase/amend_commit_with_conflict.go index 497db50d7..979bf539a 100644 --- a/pkg/integration/tests/interactive_rebase/amend_commit_with_conflict.go +++ b/pkg/integration/tests/interactive_rebase/amend_commit_with_conflict.go @@ -38,7 +38,7 @@ var AmendCommitWithConflict = NewIntegrationTest(NewIntegrationTestArgs{ Contains("pick").Contains("three"), Contains("fixup").Contains("<-- CONFLICT --- fixup! two"), Contains("─── Commits"), - Contains("two"), + Contains("two").IsSelected(), Contains("one"), ) @@ -72,7 +72,7 @@ var AmendCommitWithConflict = NewIntegrationTest(NewIntegrationTestArgs{ Contains("<-- CONFLICT --- three"), Contains("─── Commits"), Contains("two"), - Contains("one"), + Contains("one").IsSelected(), ) }, }) diff --git a/pkg/integration/tests/interactive_rebase/edit_the_confl_commit.go b/pkg/integration/tests/interactive_rebase/edit_the_confl_commit.go index 81ddf685a..b395e4747 100644 --- a/pkg/integration/tests/interactive_rebase/edit_the_confl_commit.go +++ b/pkg/integration/tests/interactive_rebase/edit_the_confl_commit.go @@ -33,7 +33,7 @@ var EditTheConflCommit = NewIntegrationTest(NewIntegrationTestArgs{ Focus(). Lines( Contains("─── Pending rebase todos"), - Contains("pick").Contains("commit two"), + Contains("pick").Contains("commit two").IsSelected(), Contains("pick").Contains("<-- CONFLICT --- commit three"), Contains("─── Commits"), Contains("commit one"), diff --git a/pkg/integration/tests/interactive_rebase/revert_multiple_commits_in_interactive_rebase.go b/pkg/integration/tests/interactive_rebase/revert_multiple_commits_in_interactive_rebase.go index da3285f04..f6758044b 100644 --- a/pkg/integration/tests/interactive_rebase/revert_multiple_commits_in_interactive_rebase.go +++ b/pkg/integration/tests/interactive_rebase/revert_multiple_commits_in_interactive_rebase.go @@ -58,8 +58,8 @@ var RevertMultipleCommitsInInteractiveRebase = NewIntegrationTest(NewIntegration Contains("revert").Contains("CI <-- CONFLICT --- add first line"), Contains("─── Commits"), Contains("CI ○ add second line"), - Contains("CI ○ add first line"), - Contains("CI ○ unrelated change 1"), + Contains("CI ○ add first line").IsSelected(), + Contains("CI ○ unrelated change 1").IsSelected(), Contains("CI ○ add empty file"), ) diff --git a/pkg/integration/tests/interactive_rebase/shared.go b/pkg/integration/tests/interactive_rebase/shared.go index d1d80fafb..c9a42c434 100644 --- a/pkg/integration/tests/interactive_rebase/shared.go +++ b/pkg/integration/tests/interactive_rebase/shared.go @@ -10,7 +10,7 @@ func handleConflictsFromSwap(t *TestDriver, expectedCommand string) { t.Views().Commits(). Lines( Contains("─── Pending rebase todos"), - Contains("pick").Contains("commit two"), + Contains("pick").Contains("commit two").IsSelected(), Contains(expectedCommand).Contains("<-- CONFLICT --- commit three"), Contains("─── Commits"), Contains("commit one"),