mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
commit integrations test with window name's assertion
This commit is contained in:
parent
87e0f6b92d
commit
bfcbf228bf
43 changed files with 27 additions and 46 deletions
|
@ -6,21 +6,21 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var Staged = NewIntegrationTest(NewIntegrationTestArgs{
|
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: "",
|
ExtraCmdArgs: "",
|
||||||
Skip: false,
|
Skip: false,
|
||||||
SetupConfig: func(config *config.AppConfig) {},
|
SetupConfig: func(config *config.AppConfig) {},
|
||||||
SetupRepo: func(shell *Shell) {
|
SetupRepo: func(shell *Shell) {
|
||||||
shell.CreateFile("myfile", "myfile content")
|
shell.
|
||||||
shell.CreateFile("myfile2", "myfile2 content")
|
CreateFile("myfile", "myfile content\nwith a second line").
|
||||||
|
CreateFile("myfile2", "myfile2 content")
|
||||||
},
|
},
|
||||||
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
|
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
|
||||||
assert.CommitCount(0)
|
assert.CommitCount(0)
|
||||||
|
|
||||||
input.PrimaryAction()
|
|
||||||
input.NextItem()
|
|
||||||
input.PrimaryAction()
|
input.PrimaryAction()
|
||||||
input.Confirm()
|
input.Confirm()
|
||||||
|
input.PrimaryAction()
|
||||||
input.PressKeys(keys.Files.CommitChanges)
|
input.PressKeys(keys.Files.CommitChanges)
|
||||||
|
|
||||||
commitMessage := "my commit message"
|
commitMessage := "my commit message"
|
||||||
|
@ -29,5 +29,6 @@ var Staged = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
|
|
||||||
assert.CommitCount(1)
|
assert.CommitCount(1)
|
||||||
assert.MatchHeadCommitMessage(Equals(commitMessage))
|
assert.MatchHeadCommitMessage(Equals(commitMessage))
|
||||||
|
assert.CurrentWindowName("stagingSecondary")
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
@ -6,20 +6,20 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var Unstaged = NewIntegrationTest(NewIntegrationTestArgs{
|
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: "",
|
ExtraCmdArgs: "",
|
||||||
Skip: false,
|
Skip: false,
|
||||||
SetupConfig: func(config *config.AppConfig) {},
|
SetupConfig: func(config *config.AppConfig) {},
|
||||||
SetupRepo: func(shell *Shell) {
|
SetupRepo: func(shell *Shell) {
|
||||||
shell.CreateFile("myfile", "myfile content")
|
shell.
|
||||||
shell.CreateFile("myfile2", "myfile2 content")
|
CreateFile("myfile", "myfile content\nwith a second line").
|
||||||
|
CreateFile("myfile2", "myfile2 content")
|
||||||
},
|
},
|
||||||
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
|
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
|
||||||
assert.CommitCount(0)
|
assert.CommitCount(0)
|
||||||
|
|
||||||
input.PrimaryAction()
|
|
||||||
input.NextItem()
|
|
||||||
input.Confirm()
|
input.Confirm()
|
||||||
|
input.PrimaryAction()
|
||||||
input.PressKeys(keys.Files.CommitChanges)
|
input.PressKeys(keys.Files.CommitChanges)
|
||||||
|
|
||||||
commitMessage := "my commit message"
|
commitMessage := "my commit message"
|
||||||
|
@ -28,5 +28,6 @@ var Unstaged = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
|
|
||||||
assert.CommitCount(1)
|
assert.CommitCount(1)
|
||||||
assert.MatchHeadCommitMessage(Equals(commitMessage))
|
assert.MatchHeadCommitMessage(Equals(commitMessage))
|
||||||
|
assert.CurrentWindowName("staging")
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
Binary file not shown.
|
@ -1 +1 @@
|
||||||
0000000000000000000000000000000000000000 ef3197feca3fdc5b9f0170f483c6ff138d5cf186 CI <CI@example.com> 1669566692 +0100 commit (initial): my commit message
|
0000000000000000000000000000000000000000 a0a4dfd8937f66345c93ee7ebf5f85d53e05e9e8 CI <CI@example.com> 1669569482 +0100 commit (initial): my commit message
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
0000000000000000000000000000000000000000 ef3197feca3fdc5b9f0170f483c6ff138d5cf186 CI <CI@example.com> 1669566692 +0100 commit (initial): my commit message
|
0000000000000000000000000000000000000000 a0a4dfd8937f66345c93ee7ebf5f85d53e05e9e8 CI <CI@example.com> 1669569482 +0100 commit (initial): my commit message
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,2 @@
|
||||||
|
x<01><>M
|
||||||
|
Т0]чo/H~<7E>ЄЁЋу%љPСGJAooСИf<>вD<1E><><0F>Оd<>Г(9ЧXkЮYћq(`$glв<6C>ctЮйЈјеяmЅiІѓ4_ёfY<66>8<EFBFBD>&2!$в0Z:jЃЕкщ>щјSWђЁ_B<5F>mуд-є0ъ
|
Binary file not shown.
Binary file not shown.
|
@ -1,2 +0,0 @@
|
||||||
x<01><>A
|
|
||||||
Â0E]ç³$™iÆD„®zŒ1<C592>ªà<C2AA>ÒFÐÛðnþâñ?³G…yWWU Qœæc‘X)§._Ã,‚N„œ%öCtòª÷²Â0Âi/ú[žzÈÅΘûÈmö>xïm'UÿÔ<C3BF>}à—€é¶ÉMݶ0
|
|
|
@ -1 +1 @@
|
||||||
ef3197feca3fdc5b9f0170f483c6ff138d5cf186
|
a0a4dfd8937f66345c93ee7ebf5f85d53e05e9e8
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
myfile content
|
myfile content
|
||||||
|
with a second line
|
|
@ -1 +0,0 @@
|
||||||
my commit message
|
|
|
@ -1 +0,0 @@
|
||||||
ref: refs/heads/master
|
|
|
@ -1,12 +0,0 @@
|
||||||
[core]
|
|
||||||
repositoryformatversion = 0
|
|
||||||
filemode = true
|
|
||||||
bare = false
|
|
||||||
logallrefupdates = true
|
|
||||||
[user]
|
|
||||||
email = CI@example.com
|
|
||||||
name = CI
|
|
||||||
[commit]
|
|
||||||
gpgSign = false
|
|
||||||
[protocol "file"]
|
|
||||||
allow = always
|
|
|
@ -1 +0,0 @@
|
||||||
Unnamed repository; edit this file 'description' to name the repository.
|
|
Binary file not shown.
|
@ -1,6 +0,0 @@
|
||||||
# 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]
|
|
||||||
# *~
|
|
|
@ -1 +0,0 @@
|
||||||
0000000000000000000000000000000000000000 28f8e24755d8792e66738e36f193949a68021709 CI <CI@example.com> 1669566470 +0100 commit (initial): my commit message
|
|
|
@ -1 +0,0 @@
|
||||||
0000000000000000000000000000000000000000 28f8e24755d8792e66738e36f193949a68021709 CI <CI@example.com> 1669566470 +0100 commit (initial): my commit message
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1 +0,0 @@
|
||||||
28f8e24755d8792e66738e36f193949a68021709
|
|
|
@ -1 +0,0 @@
|
||||||
myfile content
|
|
|
@ -1 +0,0 @@
|
||||||
myfile2 content
|
|
Binary file not shown.
|
@ -1 +1 @@
|
||||||
0000000000000000000000000000000000000000 d46951396fe8179592ec90aee0c0414fc0512fc5 CI <CI@example.com> 1669566705 +0100 commit (initial): my commit message
|
0000000000000000000000000000000000000000 109e5843c76c640d7075c2897b5720f1714df776 CI <CI@example.com> 1669569750 +0100 commit (initial): my commit message
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
0000000000000000000000000000000000000000 d46951396fe8179592ec90aee0c0414fc0512fc5 CI <CI@example.com> 1669566705 +0100 commit (initial): my commit message
|
0000000000000000000000000000000000000000 109e5843c76c640d7075c2897b5720f1714df776 CI <CI@example.com> 1669569750 +0100 commit (initial): my commit message
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,2 @@
|
||||||
|
x<01><>K
|
||||||
|
Â0@]ç³$ <09>™D„®zŒL2~À!ÒFÐÛ[ðnïñJ3»wH»¾¨‚²”*È5—KŒIQt1ŠDAª<VÉ.¿ú-0Ípœæ³¾³=z(ÍNˆRbô°÷Á{·ÑmÒõOÝÙ~ ˜®k¾ªûm±1|
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
||||||
|
x+)JMU06a040031QČLËĚIe`xäf×ĹvYRú†j°\ě~µ]‡tłö
Î
|
|
@ -1 +1 @@
|
||||||
d46951396fe8179592ec90aee0c0414fc0512fc5
|
109e5843c76c640d7075c2897b5720f1714df776
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
myfile content
|
myfile content
|
||||||
|
with a second line
|
Loading…
Add table
Add a link
Reference in a new issue