1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

commit integrations test with window name's assertion

This commit is contained in:
Arnaud PERALTA
2022-11-27 18:24:00 +01:00
committed by Jesse Duffield
parent 87e0f6b92d
commit bfcbf228bf
43 changed files with 27 additions and 46 deletions

View File

@ -6,21 +6,21 @@ import (
)
var Staged = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Staging a couple files, going in the staged files menu and committing",
Description: "Staging a couple files, going in the staged files menu, unstaging a line then committing",
ExtraCmdArgs: "",
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
shell.CreateFile("myfile", "myfile content")
shell.CreateFile("myfile2", "myfile2 content")
shell.
CreateFile("myfile", "myfile content\nwith a second line").
CreateFile("myfile2", "myfile2 content")
},
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
assert.CommitCount(0)
input.PrimaryAction()
input.NextItem()
input.PrimaryAction()
input.Confirm()
input.PrimaryAction()
input.PressKeys(keys.Files.CommitChanges)
commitMessage := "my commit message"
@ -29,5 +29,6 @@ var Staged = NewIntegrationTest(NewIntegrationTestArgs{
assert.CommitCount(1)
assert.MatchHeadCommitMessage(Equals(commitMessage))
assert.CurrentWindowName("stagingSecondary")
},
})

View File

@ -6,20 +6,20 @@ import (
)
var Unstaged = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Staging a couple files, going in the unstaged files menu and committing",
Description: "Staging a couple files, going in the unstaged files menu, staging a line and committing",
ExtraCmdArgs: "",
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
shell.CreateFile("myfile", "myfile content")
shell.CreateFile("myfile2", "myfile2 content")
shell.
CreateFile("myfile", "myfile content\nwith a second line").
CreateFile("myfile2", "myfile2 content")
},
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
assert.CommitCount(0)
input.PrimaryAction()
input.NextItem()
input.Confirm()
input.PrimaryAction()
input.PressKeys(keys.Files.CommitChanges)
commitMessage := "my commit message"
@ -28,5 +28,6 @@ var Unstaged = NewIntegrationTest(NewIntegrationTestArgs{
assert.CommitCount(1)
assert.MatchHeadCommitMessage(Equals(commitMessage))
assert.CurrentWindowName("staging")
},
})