mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-03-27 22:01:46 +02:00
Add tests of interactive rebase with custom comment character
This commit is contained in:
parent
7cb54f4fee
commit
cff9850374
@ -0,0 +1,42 @@
|
|||||||
|
package interactive_rebase
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/jesseduffield/lazygit/pkg/config"
|
||||||
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||||
|
)
|
||||||
|
|
||||||
|
var DropWithCustomCommentChar = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
|
Description: "Drops a commit with the 'core.commentChar' option set to a custom character",
|
||||||
|
ExtraCmdArgs: []string{},
|
||||||
|
Skip: false,
|
||||||
|
SetupConfig: func(config *config.AppConfig) {},
|
||||||
|
SetupRepo: func(shell *Shell) {
|
||||||
|
shell.SetConfig("core.commentChar", ";")
|
||||||
|
shell.CreateNCommits(2)
|
||||||
|
},
|
||||||
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||||
|
t.Views().Commits().Focus().
|
||||||
|
Lines(
|
||||||
|
Contains("commit 02").IsSelected(),
|
||||||
|
Contains("commit 01"),
|
||||||
|
).
|
||||||
|
Press(keys.Universal.Remove).
|
||||||
|
Tap(func() {
|
||||||
|
t.ExpectPopup().Confirmation().
|
||||||
|
Title(Equals("Delete commit")).
|
||||||
|
Content(Equals("Are you sure you want to delete this commit?")).
|
||||||
|
Confirm()
|
||||||
|
}).
|
||||||
|
// The following behavior requires correction:
|
||||||
|
Tap(func() {
|
||||||
|
t.ExpectPopup().Alert().
|
||||||
|
Title(Equals("Error")).
|
||||||
|
Content(Contains("failed to parse line")).
|
||||||
|
Confirm()
|
||||||
|
}).
|
||||||
|
Lines(
|
||||||
|
Contains("commit 02").IsSelected(),
|
||||||
|
Contains("commit 01"),
|
||||||
|
)
|
||||||
|
},
|
||||||
|
})
|
@ -0,0 +1,36 @@
|
|||||||
|
package interactive_rebase
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/jesseduffield/lazygit/pkg/config"
|
||||||
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||||
|
)
|
||||||
|
|
||||||
|
var MoveWithCustomCommentChar = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
|
Description: "Directly moves a commit down and back up with the 'core.commentChar' option set to a custom character",
|
||||||
|
ExtraCmdArgs: []string{},
|
||||||
|
Skip: false,
|
||||||
|
SetupConfig: func(config *config.AppConfig) {},
|
||||||
|
SetupRepo: func(shell *Shell) {
|
||||||
|
shell.SetConfig("core.commentChar", ";")
|
||||||
|
shell.CreateNCommits(2)
|
||||||
|
},
|
||||||
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||||
|
t.Views().Commits().Focus().
|
||||||
|
Lines(
|
||||||
|
Contains("commit 02").IsSelected(),
|
||||||
|
Contains("commit 01"),
|
||||||
|
).
|
||||||
|
Press(keys.Commits.MoveDownCommit).
|
||||||
|
// The following behavior requires correction:
|
||||||
|
Tap(func() {
|
||||||
|
t.ExpectPopup().Alert().
|
||||||
|
Title(Equals("Error")).
|
||||||
|
Content(Contains("failed to parse line")).
|
||||||
|
Confirm()
|
||||||
|
}).
|
||||||
|
Lines(
|
||||||
|
Contains("commit 02").IsSelected(),
|
||||||
|
Contains("commit 01"),
|
||||||
|
)
|
||||||
|
},
|
||||||
|
})
|
@ -103,6 +103,7 @@ var tests = []*components.IntegrationTest{
|
|||||||
interactive_rebase.AmendNonHeadCommitDuringRebase,
|
interactive_rebase.AmendNonHeadCommitDuringRebase,
|
||||||
interactive_rebase.DropTodoCommitWithUpdateRef,
|
interactive_rebase.DropTodoCommitWithUpdateRef,
|
||||||
interactive_rebase.DropTodoCommitWithUpdateRefShowBranchHeads,
|
interactive_rebase.DropTodoCommitWithUpdateRefShowBranchHeads,
|
||||||
|
interactive_rebase.DropWithCustomCommentChar,
|
||||||
interactive_rebase.EditFirstCommit,
|
interactive_rebase.EditFirstCommit,
|
||||||
interactive_rebase.EditNonTodoCommitDuringRebase,
|
interactive_rebase.EditNonTodoCommitDuringRebase,
|
||||||
interactive_rebase.EditTheConflCommit,
|
interactive_rebase.EditTheConflCommit,
|
||||||
@ -110,6 +111,7 @@ var tests = []*components.IntegrationTest{
|
|||||||
interactive_rebase.FixupSecondCommit,
|
interactive_rebase.FixupSecondCommit,
|
||||||
interactive_rebase.Move,
|
interactive_rebase.Move,
|
||||||
interactive_rebase.MoveInRebase,
|
interactive_rebase.MoveInRebase,
|
||||||
|
interactive_rebase.MoveWithCustomCommentChar,
|
||||||
interactive_rebase.PickRescheduled,
|
interactive_rebase.PickRescheduled,
|
||||||
interactive_rebase.Rebase,
|
interactive_rebase.Rebase,
|
||||||
interactive_rebase.RewordCommitWithEditorAndFail,
|
interactive_rebase.RewordCommitWithEditorAndFail,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user