mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-12 16:46:25 -04:00
test: add test for stash including untracked files
This commit is contained in:
parent
f4c188fa5b
commit
a30d924afe
|
|
@ -17,6 +17,7 @@ var Stash = NewIntegrationTest(NewIntegrationTestArgs{
|
|||
},
|
||||
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
|
||||
assert.StashCount(0)
|
||||
assert.WorkingTreeFileCount(1)
|
||||
|
||||
input.PressKeys(keys.Files.ViewStashOptions)
|
||||
assert.InMenu()
|
||||
|
|
@ -26,5 +27,6 @@ var Stash = NewIntegrationTest(NewIntegrationTestArgs{
|
|||
input.Confirm()
|
||||
|
||||
assert.StashCount(1)
|
||||
assert.WorkingTreeFileCount(0)
|
||||
},
|
||||
})
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
package stash
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var StashIncludingUntrackedFiles = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Stashing all files including untracked ones",
|
||||
ExtraCmdArgs: "",
|
||||
Skip: false,
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.EmptyCommit("initial commit")
|
||||
shell.CreateFile("file_1", "content")
|
||||
shell.CreateFile("file_2", "content")
|
||||
shell.GitAdd("file_1")
|
||||
},
|
||||
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
|
||||
assert.StashCount(0)
|
||||
assert.WorkingTreeFileCount(2)
|
||||
|
||||
input.PressKeys(keys.Files.ViewStashOptions)
|
||||
assert.InMenu()
|
||||
|
||||
input.PressKeys("U")
|
||||
input.Type("stash name")
|
||||
input.Confirm()
|
||||
|
||||
assert.StashCount(1)
|
||||
assert.WorkingTreeFileCount(0)
|
||||
},
|
||||
})
|
||||
|
|
@ -29,6 +29,7 @@ var tests = []*components.IntegrationTest{
|
|||
custom_commands.MultiplePrompts,
|
||||
custom_commands.MenuFromCommand,
|
||||
stash.Stash,
|
||||
stash.StashIncludingUntrackedFiles,
|
||||
}
|
||||
|
||||
func GetTests() []*components.IntegrationTest {
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
initial commit
|
||||
|
|
@ -0,0 +1 @@
|
|||
ref: refs/heads/master
|
||||
|
|
@ -0,0 +1 @@
|
|||
d25b2c8a3d20c1b1884fbf1c87aa2014dd99ed7f
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
[core]
|
||||
repositoryformatversion = 0
|
||||
filemode = true
|
||||
bare = false
|
||||
logallrefupdates = true
|
||||
ignorecase = true
|
||||
precomposeunicode = true
|
||||
[user]
|
||||
email = CI@example.com
|
||||
name = CI
|
||||
[commit]
|
||||
gpgSign = false
|
||||
|
|
@ -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,2 @@
|
|||
0000000000000000000000000000000000000000 d25b2c8a3d20c1b1884fbf1c87aa2014dd99ed7f CI <CI@example.com> 1665105632 -0230 commit (initial): initial commit
|
||||
d25b2c8a3d20c1b1884fbf1c87aa2014dd99ed7f d25b2c8a3d20c1b1884fbf1c87aa2014dd99ed7f CI <CI@example.com> 1665105633 -0230 reset: moving to HEAD
|
||||
|
|
@ -0,0 +1 @@
|
|||
0000000000000000000000000000000000000000 d25b2c8a3d20c1b1884fbf1c87aa2014dd99ed7f CI <CI@example.com> 1665105632 -0230 commit (initial): initial commit
|
||||
|
|
@ -0,0 +1 @@
|
|||
0000000000000000000000000000000000000000 b8eb39e727d4ac91542d57faa0bea0458c2d30e3 CI <CI@example.com> 1665105633 -0230 On master: stash name
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,2 @@
|
|||
xЌПMJ1`Ч}Љ\@©Є¤т#"В¬fе*©
|
||||
#<23>оЎ;‚З·7іwышxјЧ¶1ѕ¦уаџжnжT-"¶ђ«ІFн9ХR:S(T2c…dMКr—ЭЦй”ёRЛв• aЕњCЇ[N"TK1Mэ዆¹0qЏН'Е”„ЅpТLјќ Е‡п™)K>KjгДђЕ*Ш3AВ°ИПјm»»\ЭЫеъaї2оЯцТ¶со0FFаиЅ{т°њйyzЪ?щт№є!Зй_Э1её№U†эяґY`
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,2 @@
|
|||
xЌЌ]
|
||||
В0„}О)цJ~7AЉ}к1’нЉБ¦‘6ЏoАш6Я|Cµ”Ь@…pjsЮ“BШIo5Z,&“RТ–04Ћ|B+вСћuѓq‚aњоь‰еЅр…j№ЃBtJ:4ОR)zЫOя‰‹cm[¤ПрИпPW(qпы+МЪ%Mтљ[ЋьФвЋ:ћ
|
||||
|
|
@ -0,0 +1 @@
|
|||
d25b2c8a3d20c1b1884fbf1c87aa2014dd99ed7f
|
||||
|
|
@ -0,0 +1 @@
|
|||
b8eb39e727d4ac91542d57faa0bea0458c2d30e3
|
||||
Loading…
Reference in a new issue