diff --git a/pkg/integration/tests/commit/paste_multi_line_commit_message.go b/pkg/integration/tests/commit/paste_multi_line_commit_message.go new file mode 100644 index 000000000..cdee917a9 --- /dev/null +++ b/pkg/integration/tests/commit/paste_multi_line_commit_message.go @@ -0,0 +1,33 @@ +package commit + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var PasteMultiLineCommitMessage = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Paste a multi-line commit message into the summary with the terminal's paste command", + ExtraCmdArgs: []string{}, + Skip: false, + SetupConfig: func(config *config.AppConfig) {}, + SetupRepo: func(shell *Shell) { + shell.CreateFileAndAdd("file", "file content") + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Files(). + Focus(). + Press(keys.Files.CommitChanges) + + t.ExpectPopup().CommitMessagePanel(). + Paste("subject\n\nbody line 1\nbody line 2"). + Content(Equals("subject")) + + t.Views().CommitDescription(). + IsFocused(). + Content(Equals( + /* EXPECTED: + "body line 1\nbody line 2")) + ACTUAL: */ + "\nbody line 1\nbody line 2")) + }, +}) diff --git a/pkg/integration/tests/test_list.go b/pkg/integration/tests/test_list.go index 4acb7f181..4a22b66f2 100644 --- a/pkg/integration/tests/test_list.go +++ b/pkg/integration/tests/test_list.go @@ -187,6 +187,7 @@ var tests = []*components.IntegrationTest{ commit.PasteCommitMessageOverExisting, commit.PasteCommitMessageWithHardLineBreaks, commit.PasteIntoCommitDescription, + commit.PasteMultiLineCommitMessage, commit.PreserveCommitMessage, commit.PreserveCommitMessageWhitespace, commit.ResetAuthor,