mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-04 03:48:07 +02:00
integration tests for commit without pre-commit hooks in staging files menu
This commit is contained in:
parent
bfcbf228bf
commit
50b0d85cd3
34
pkg/integration/tests/commit/staged_without_hooks.go
Normal file
34
pkg/integration/tests/commit/staged_without_hooks.go
Normal file
@ -0,0 +1,34 @@
|
||||
package commit
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var StagedWithoutHooks = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Staging a couple files, going in the staged files menu, unstaging a line then committing without pre-commit hooks",
|
||||
ExtraCmdArgs: "",
|
||||
Skip: false,
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
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.Confirm()
|
||||
input.PrimaryAction()
|
||||
input.PressKeys(keys.Files.CommitChangesWithoutHook)
|
||||
|
||||
commitMessage := "my commit message"
|
||||
input.Type(commitMessage)
|
||||
input.Confirm()
|
||||
|
||||
assert.CommitCount(1)
|
||||
assert.MatchHeadCommitMessage(Equals("WIP" + commitMessage))
|
||||
assert.CurrentWindowName("stagingSecondary")
|
||||
},
|
||||
})
|
33
pkg/integration/tests/commit/unstaged_without_hooks.go
Normal file
33
pkg/integration/tests/commit/unstaged_without_hooks.go
Normal file
@ -0,0 +1,33 @@
|
||||
package commit
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var UnstagedWithoutHooks = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Staging a couple files, going in the unstaged files menu, staging a line and committing without pre-commit hooks",
|
||||
ExtraCmdArgs: "",
|
||||
Skip: false,
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
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.Confirm()
|
||||
input.PrimaryAction()
|
||||
input.PressKeys(keys.Files.CommitChangesWithoutHook)
|
||||
|
||||
commitMessage := "my commit message"
|
||||
input.Type(commitMessage)
|
||||
input.Confirm()
|
||||
|
||||
assert.CommitCount(1)
|
||||
assert.MatchHeadCommitMessage(Equals("WIP" + commitMessage))
|
||||
assert.CurrentWindowName("staging")
|
||||
},
|
||||
})
|
@ -38,6 +38,8 @@ var tests = []*components.IntegrationTest{
|
||||
commit.NewBranch,
|
||||
commit.Staged,
|
||||
commit.Unstaged,
|
||||
commit.StagedWithoutHooks,
|
||||
commit.UnstagedWithoutHooks,
|
||||
custom_commands.Basic,
|
||||
custom_commands.FormPrompts,
|
||||
custom_commands.MenuFromCommand,
|
||||
|
@ -0,0 +1 @@
|
||||
WIPmy commit message
|
@ -0,0 +1 @@
|
||||
ref: refs/heads/master
|
@ -0,0 +1,12 @@
|
||||
[core]
|
||||
repositoryformatversion = 0
|
||||
filemode = true
|
||||
bare = false
|
||||
logallrefupdates = true
|
||||
[user]
|
||||
email = CI@example.com
|
||||
name = CI
|
||||
[commit]
|
||||
gpgSign = false
|
||||
[protocol "file"]
|
||||
allow = always
|
@ -0,0 +1 @@
|
||||
Unnamed repository; edit this file 'description' to name the repository.
|
Binary file not shown.
@ -0,0 +1,6 @@
|
||||
# git ls-files --others --exclude-from=.git/info/exclude
|
||||
# Lines that start with '#' are comments.
|
||||
# For a project mostly in C, the following would be a good set of
|
||||
# exclude patterns (uncomment them if you want to use them):
|
||||
# *.[oa]
|
||||
# *~
|
@ -0,0 +1 @@
|
||||
0000000000000000000000000000000000000000 4a33e6274dd3bc702442966e6774e7688bb7af64 CI <CI@example.com> 1669660775 +0100 commit (initial): WIPmy commit message
|
@ -0,0 +1 @@
|
||||
0000000000000000000000000000000000000000 4a33e6274dd3bc702442966e6774e7688bb7af64 CI <CI@example.com> 1669660775 +0100 commit (initial): WIPmy commit message
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@
|
||||
4a33e6274dd3bc702442966e6774e7688bb7af64
|
@ -0,0 +1,2 @@
|
||||
myfile content
|
||||
with a second line
|
@ -0,0 +1 @@
|
||||
myfile2 content
|
@ -0,0 +1 @@
|
||||
WIPmy commit message
|
@ -0,0 +1 @@
|
||||
ref: refs/heads/master
|
@ -0,0 +1,12 @@
|
||||
[core]
|
||||
repositoryformatversion = 0
|
||||
filemode = true
|
||||
bare = false
|
||||
logallrefupdates = true
|
||||
[user]
|
||||
email = CI@example.com
|
||||
name = CI
|
||||
[commit]
|
||||
gpgSign = false
|
||||
[protocol "file"]
|
||||
allow = always
|
@ -0,0 +1 @@
|
||||
Unnamed repository; edit this file 'description' to name the repository.
|
Binary file not shown.
@ -0,0 +1,6 @@
|
||||
# git ls-files --others --exclude-from=.git/info/exclude
|
||||
# Lines that start with '#' are comments.
|
||||
# For a project mostly in C, the following would be a good set of
|
||||
# exclude patterns (uncomment them if you want to use them):
|
||||
# *.[oa]
|
||||
# *~
|
@ -0,0 +1 @@
|
||||
0000000000000000000000000000000000000000 ebc03af0e92eb50f1ab1dec0697880ed9da9b02d CI <CI@example.com> 1669660788 +0100 commit (initial): WIPmy commit message
|
@ -0,0 +1 @@
|
||||
0000000000000000000000000000000000000000 ebc03af0e92eb50f1ab1dec0697880ed9da9b02d CI <CI@example.com> 1669660788 +0100 commit (initial): WIPmy commit message
|
Binary file not shown.
@ -0,0 +1 @@
|
||||
x+)JMU06a040031QČLËĚIe`xäf×ĹvYRú†j°\ě~µ]‡tłö
Î
|
Binary file not shown.
@ -0,0 +1 @@
|
||||
ebc03af0e92eb50f1ab1dec0697880ed9da9b02d
|
@ -0,0 +1,2 @@
|
||||
myfile content
|
||||
with a second line
|
@ -0,0 +1 @@
|
||||
myfile2 content
|
Loading…
Reference in New Issue
Block a user