summaryrefslogtreecommitdiffstats
path: root/pkg/integration
diff options
context:
space:
mode:
authorGustavo Krieger <gustavopcassol@gmail.com>2023-07-02 00:21:17 -0300
committerGustavo Krieger <gustavopcassol@gmail.com>2023-07-02 02:07:32 -0300
commitcff9850374097f60d8bf39290d1dcb2b51ec0c91 (patch)
tree85a55c80f6aa0b1a6ec771a160832b9218a20eb9 /pkg/integration
parent7cb54f4fee215a26359a835ca804721432b2dcfe (diff)
Add tests of interactive rebase with custom comment character
Diffstat (limited to 'pkg/integration')
-rw-r--r--pkg/integration/tests/interactive_rebase/drop_with_custom_comment_char.go42
-rw-r--r--pkg/integration/tests/interactive_rebase/move_with_custom_comment_char.go36
-rw-r--r--pkg/integration/tests/test_list.go2
3 files changed, 80 insertions, 0 deletions
diff --git a/pkg/integration/tests/interactive_rebase/drop_with_custom_comment_char.go b/pkg/integration/tests/interactive_rebase/drop_with_custom_comment_char.go
new file mode 100644
index 000000000..6e93b6faa
--- /dev/null
+++ b/pkg/integration/tests/interactive_rebase/drop_with_custom_comment_char.go
@@ -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"),
+ )
+ },
+})
diff --git a/pkg/integration/tests/interactive_rebase/move_with_custom_comment_char.go b/pkg/integration/tests/interactive_rebase/move_with_custom_comment_char.go
new file mode 100644
index 000000000..0ff03169d
--- /dev/null
+++ b/pkg/integration/tests/interactive_rebase/move_with_custom_comment_char.go
@@ -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"),
+ )
+ },
+})
diff --git a/pkg/integration/tests/test_list.go b/pkg/integration/tests/test_list.go
index c1549df83..99b7f2bdc 100644
--- a/pkg/integration/tests/test_list.go
+++ b/pkg/integration/tests/test_list.go
@@ -103,6 +103,7 @@ var tests = []*components.IntegrationTest{
interactive_rebase.AmendNonHeadCommitDuringRebase,
interactive_rebase.DropTodoCommitWithUpdateRef,
interactive_rebase.DropTodoCommitWithUpdateRefShowBranchHeads,
+ interactive_rebase.DropWithCustomCommentChar,
interactive_rebase.EditFirstCommit,
interactive_rebase.EditNonTodoCommitDuringRebase,
interactive_rebase.EditTheConflCommit,
@@ -110,6 +111,7 @@ var tests = []*components.IntegrationTest{
interactive_rebase.FixupSecondCommit,
interactive_rebase.Move,
interactive_rebase.MoveInRebase,
+ interactive_rebase.MoveWithCustomCommentChar,
interactive_rebase.PickRescheduled,
interactive_rebase.Rebase,
interactive_rebase.RewordCommitWithEditorAndFail,