1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-04 03:48:07 +02:00

improved commit test

This commit is contained in:
Jesse Duffield 2023-02-19 19:05:48 +11:00
parent ac580ae6a0
commit 9e2a3a87dd

View File

@ -20,18 +20,42 @@ var Commit = NewIntegrationTest(NewIntegrationTestArgs{
t.Views().Files().
IsFocused().
Lines(
Contains("?? myfile").IsSelected(),
Contains("?? myfile2"),
).
PressPrimaryAction(). // stage file
Lines(
Contains("A myfile").IsSelected(),
Contains("?? myfile2"),
).
SelectNextItem().
PressPrimaryAction(). // stage other file
Lines(
Contains("A myfile"),
Contains("A myfile2").IsSelected(),
).
Press(keys.Files.CommitChanges)
commitMessage := "my commit message"
t.ExpectPopup().CommitMessagePanel().Type(commitMessage).Confirm()
t.Views().Files().
IsEmpty()
t.Views().Commits().
Focus().
Lines(
Contains(commitMessage),
Contains(commitMessage).IsSelected(),
).
PressEnter()
t.Views().CommitFiles().
IsFocused().
Lines(
Contains("A myfile"),
Contains("A myfile2"),
)
},
})