1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-03 00:57:52 +02:00
Files
.devcontainer
.github
.vscode
cmd
demo
docs
pkg
app
cheatsheet
commands
common
config
constants
env
fakes
gui
i18n
integration
clients
components
tests
bisect
branch
cherry_pick
commit
config
conflicts
custom_commands
demo
diff
file
collapse_expand.go
copy_menu.go
dir_with_untracked_file.go
discard_all_dir_changes.go
discard_range_select.go
discard_staged_changes.go
discard_unstaged_dir_changes.go
discard_unstaged_file_changes.go
discard_unstaged_range_select.go
discard_various_changes.go
discard_various_changes_range_select.go
gitignore.go
gitignore_special_characters.go
remember_commit_message_after_fail.go
rename_similarity_threshold_change.go
renamed_files.go
shared.go
stage_children_range_select.go
stage_deleted_range_select.go
stage_range_select.go
filter_and_search
filter_by_author
filter_by_path
interactive_rebase
misc
patch_building
reflog
shared
shell_commands
staging
stash
status
submodule
sync
tag
ui
undo
worktree
test_list.go
test_list_generator.go
tests.go
types
README.md
jsonschema
logs
snake
tasks
theme
updates
utils
schema
scripts
test
vendor
.codespellrc
.editorconfig
.gitattributes
.gitignore
.golangci.yml
.goreleaser.yml
CODE-OF-CONDUCT.md
CONTRIBUTING.md
Dockerfile
LICENSE
Makefile
README.md
VISION.md
go.mod
go.sum
main.go
lazygit/pkg/integration/tests/file/collapse_expand.go
2025-03-21 08:04:58 +01:00

48 lines
1.1 KiB
Go

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(
Equals("▼ /").IsSelected(),
Equals(" ▼ dir"),
Equals(" ?? file-one"),
Equals(" ▼ dir2"),
Equals(" ?? file-two"),
)
t.Views().Files().
Press(keys.Files.CollapseAll).
Lines(
Equals("▶ /"),
)
t.Views().Files().
Press(keys.Files.ExpandAll).
Lines(
Equals("▼ /").IsSelected(),
Equals(" ▼ dir"),
Equals(" ?? file-one"),
Equals(" ▼ dir2"),
Equals(" ?? file-two"),
)
},
})