lazygit/pkg/integration/tests/interactive_rebase/shared.go
Stefan Haller 362678e2ef Mention which command is continued in PromptToContinueRebase
When you are in the middle of a rebase, and you cherry-pick a commit which
conflicts, it helps to be clear on whether you are prompted to continue the
cherry-pick or the rebase.
2025-04-20 15:53:17 +02:00

75 lines
1.5 KiB
Go

package interactive_rebase
import (
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
func handleConflictsFromSwap(t *TestDriver) {
t.Common().AcknowledgeConflicts()
t.Views().Commits().
Lines(
Contains("pick").Contains("commit two"),
Contains("conflict").Contains("<-- YOU ARE HERE --- commit three"),
Contains("commit one"),
)
t.Views().Files().
IsFocused().
Lines(
Contains("UU myfile"),
).
PressEnter()
t.Views().MergeConflicts().
IsFocused().
TopLines(
Contains("<<<<<<< HEAD"),
Contains("one"),
Contains("======="),
Contains("three"),
Contains(">>>>>>>"),
).
SelectNextItem().
PressPrimaryAction() // pick "three"
t.Common().ContinueOnConflictsResolved("rebase")
t.Common().AcknowledgeConflicts()
t.Views().Files().
IsFocused().
Lines(
Contains("UU myfile"),
).
PressEnter()
t.Views().MergeConflicts().
IsFocused().
TopLines(
Contains("<<<<<<< HEAD"),
Contains("three"),
Contains("======="),
Contains("two"),
Contains(">>>>>>>"),
).
SelectNextItem().
PressPrimaryAction() // pick "two"
t.Common().ContinueOnConflictsResolved("rebase")
t.Views().Commits().
Focus().
Lines(
Contains("commit two").IsSelected(),
Contains("commit three"),
Contains("commit one"),
).
Tap(func() {
t.Views().Main().Content(Contains("-three").Contains("+two"))
}).
SelectNextItem().
Tap(func() {
t.Views().Main().Content(Contains("-one").Contains("+three"))
})
}