From 09a4e0b2096cf394d675cb4c5e487ad1c31601a5 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Wed, 2 Jul 2025 18:56:16 +0200 Subject: [PATCH] Add selection assertions to cherry-pick tests We are about to change the selection behavior when cherry-picking, and it's good to have tests that document in what way it changes in the next commit. --- pkg/integration/tests/cherry_pick/cherry_pick.go | 4 ++-- pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go | 4 ++-- .../tests/cherry_pick/cherry_pick_during_rebase.go | 4 ++-- pkg/integration/tests/cherry_pick/cherry_pick_range.go | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/integration/tests/cherry_pick/cherry_pick.go b/pkg/integration/tests/cherry_pick/cherry_pick.go index bfa02c5a3..434e15d8c 100644 --- a/pkg/integration/tests/cherry_pick/cherry_pick.go +++ b/pkg/integration/tests/cherry_pick/cherry_pick.go @@ -73,7 +73,7 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{ t.Views().Information().Content(DoesNotContain("commits copied")) }). Lines( - Contains("four"), + Contains("four").IsSelected(), Contains("three"), Contains("two"), Contains("one"), @@ -102,7 +102,7 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{ t.Views().Information().Content(DoesNotContain("commits copied")) }). Lines( - Contains("four"), + Contains("four").IsSelected(), Contains("three"), Contains("base"), ) diff --git a/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go b/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go index 2f0df7498..f3d5eca82 100644 --- a/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go +++ b/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go @@ -43,7 +43,7 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{ t.Views().Commits(). Focus(). TopLines( - Contains("first change"), + Contains("first change").IsSelected(), ). Press(keys.Commits.PasteCommits) @@ -76,7 +76,7 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{ t.Views().Commits(). Focus(). TopLines( - Contains("second-change-branch unrelated change"), + Contains("second-change-branch unrelated change").IsSelected(), Contains("second change"), Contains("first change"), ). diff --git a/pkg/integration/tests/cherry_pick/cherry_pick_during_rebase.go b/pkg/integration/tests/cherry_pick/cherry_pick_during_rebase.go index 7974995df..e94a0342c 100644 --- a/pkg/integration/tests/cherry_pick/cherry_pick_during_rebase.go +++ b/pkg/integration/tests/cherry_pick/cherry_pick_during_rebase.go @@ -79,7 +79,7 @@ var CherryPickDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{ Contains("--- Pending rebase todos ---"), Contains("pick CI two"), Contains("--- Commits ---"), - Contains(" CI three"), + Contains(" CI three").IsSelected(), Contains(" CI one"), Contains(" CI base"), ). @@ -88,7 +88,7 @@ var CherryPickDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{ }). Lines( Contains("CI two"), - Contains("CI three"), + Contains("CI three").IsSelected(), Contains("CI one"), Contains("CI base"), ) diff --git a/pkg/integration/tests/cherry_pick/cherry_pick_range.go b/pkg/integration/tests/cherry_pick/cherry_pick_range.go index e41d64f4a..fc1c3b2e5 100644 --- a/pkg/integration/tests/cherry_pick/cherry_pick_range.go +++ b/pkg/integration/tests/cherry_pick/cherry_pick_range.go @@ -70,7 +70,7 @@ var CherryPickRange = NewIntegrationTest(NewIntegrationTestArgs{ t.Views().Information().Content(DoesNotContain("commits copied")) }). Lines( - Contains("four"), + Contains("four").IsSelected(), Contains("three"), Contains("two"), Contains("one"),