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.
This commit is contained in:
Stefan Haller 2026-08-14 18:35:09 +02:00
parent aa38daff98
commit 6417da5319
9 changed files with 12 additions and 12 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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(),
)
},
})

View file

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

View file

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

View file

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