mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-11-29 22:48:24 +02:00
Collapse/expand all files in tree
Co-authored-by: Stefan Haller <stefan@haller-berlin.de>
This commit is contained in:
committed by
Stefan Haller
parent
14a91d9829
commit
7bea41534b
46
pkg/integration/tests/file/collapse_expand.go
Normal file
46
pkg/integration/tests/file/collapse_expand.go
Normal file
@@ -0,0 +1,46 @@
|
||||
package file
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var CollapseExpand = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Collapsing and expanding all files in the file tree",
|
||||
ExtraCmdArgs: []string{},
|
||||
Skip: false,
|
||||
SetupConfig: func(config *config.AppConfig) {
|
||||
},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.CreateDir("dir")
|
||||
shell.CreateFile("dir/file-one", "original content\n")
|
||||
shell.CreateDir("dir2")
|
||||
shell.CreateFile("dir2/file-two", "original content\n")
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Views().Files().
|
||||
IsFocused().
|
||||
Lines(
|
||||
Contains("dir").IsSelected(),
|
||||
Contains("??").Contains("file-one"),
|
||||
Contains("dir2"),
|
||||
Contains("??").Contains("file-two"),
|
||||
)
|
||||
|
||||
t.Views().Files().
|
||||
Press(keys.Files.CollapseAll).
|
||||
Lines(
|
||||
Contains("dir"),
|
||||
Contains("dir2"),
|
||||
)
|
||||
|
||||
t.Views().Files().
|
||||
Press(keys.Files.ExpandAll).
|
||||
Lines(
|
||||
Contains("dir").IsSelected(),
|
||||
Contains("??").Contains("file-one"),
|
||||
Contains("dir2"),
|
||||
Contains("??").Contains("file-two"),
|
||||
)
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user