-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93d39c8
commit d36d887
Showing
3 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
pkg/integration/tests/commit/add_co_author_while_committing.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package commit | ||
|
||
import ( | ||
"github.com/jesseduffield/lazygit/pkg/config" | ||
. "github.com/jesseduffield/lazygit/pkg/integration/components" | ||
) | ||
|
||
var AddCoAuthorWhileCommitting = NewIntegrationTest(NewIntegrationTestArgs{ | ||
Description: "Add co-author while typing the commit message", | ||
ExtraCmdArgs: []string{}, | ||
Skip: false, | ||
SetupConfig: func(config *config.AppConfig) { | ||
}, | ||
SetupRepo: func(shell *Shell) { | ||
shell.CreateFile("file", "file content") | ||
}, | ||
Run: func(t *TestDriver, keys config.KeybindingConfig) { | ||
t.Views().Files(). | ||
IsFocused(). | ||
PressPrimaryAction(). // stage file | ||
Press(keys.Files.CommitChanges) | ||
|
||
t.ExpectPopup().CommitMessagePanel(). | ||
Type("Subject"). | ||
SwitchToDescription(). | ||
Type("Here's my message."). | ||
AddCoAuthor("John Doe <[email protected]>"). | ||
Content(Equals("Here's my message.\n\nCo-authored-by: John Doe <[email protected]>")). | ||
AddCoAuthor("Jane Smith <[email protected]>"). | ||
// Second co-author doesn't add a blank line: | ||
Content(Equals("Here's my message.\n\nCo-authored-by: John Doe <[email protected]>\nCo-authored-by: Jane Smith <[email protected]>")). | ||
SwitchToSummary(). | ||
Confirm() | ||
|
||
t.Views().Commits(). | ||
Lines( | ||
Contains("Subject"), | ||
). | ||
Focus(). | ||
Tap(func() { | ||
t.Views().Main().ContainsLines( | ||
Equals(" Subject"), | ||
Equals(" "), | ||
Equals(" Here's my message."), | ||
Equals(" "), | ||
Equals(" Co-authored-by: John Doe <[email protected]>"), | ||
Equals(" Co-authored-by: Jane Smith <[email protected]>"), | ||
) | ||
}) | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters