mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-19 00:28:03 +02:00
combine assert and input structs, clean up interface
This commit is contained in:
@ -14,19 +14,21 @@ var Commit = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
shell.CreateFile("myfile", "myfile content")
|
||||
shell.CreateFile("myfile2", "myfile2 content")
|
||||
},
|
||||
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
|
||||
assert.Model().CommitCount(0)
|
||||
Run: func(shell *Shell, input *Input, keys config.KeybindingConfig) {
|
||||
input.Model().CommitCount(0)
|
||||
|
||||
input.PrimaryAction()
|
||||
input.NextItem()
|
||||
input.PrimaryAction()
|
||||
input.Press(keys.Files.CommitChanges)
|
||||
input.Views().Files().
|
||||
IsFocused().
|
||||
PressPrimaryAction(). // stage file
|
||||
SelectNextItem().
|
||||
PressPrimaryAction(). // stage other file
|
||||
Press(keys.Files.CommitChanges)
|
||||
|
||||
commitMessage := "my commit message"
|
||||
|
||||
input.CommitMessagePanel().Type(commitMessage).Confirm()
|
||||
input.ExpectCommitMessagePanel().Type(commitMessage).Confirm()
|
||||
|
||||
assert.Model().CommitCount(1)
|
||||
assert.Model().HeadCommitMessage(Equals(commitMessage))
|
||||
input.Model().CommitCount(1)
|
||||
input.Model().HeadCommitMessage(Equals(commitMessage))
|
||||
},
|
||||
})
|
||||
|
Reference in New Issue
Block a user