summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/ui/empty_menu.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/integration/tests/ui/empty_menu.go')
-rw-r--r--pkg/integration/tests/ui/empty_menu.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/pkg/integration/tests/ui/empty_menu.go b/pkg/integration/tests/ui/empty_menu.go
new file mode 100644
index 000000000..d6b3b42f0
--- /dev/null
+++ b/pkg/integration/tests/ui/empty_menu.go
@@ -0,0 +1,31 @@
+package ui
+
+import (
+ "github.com/jesseduffield/lazygit/pkg/config"
+ . "github.com/jesseduffield/lazygit/pkg/integration/components"
+)
+
+var EmptyMenu = NewIntegrationTest(NewIntegrationTestArgs{
+ Description: "Verify that we don't crash on an empty menu",
+ ExtraCmdArgs: []string{},
+ Skip: false,
+ SetupConfig: func(config *config.AppConfig) {},
+ SetupRepo: func(shell *Shell) {
+ },
+ Run: func(t *TestDriver, keys config.KeybindingConfig) {
+ t.Views().Files().
+ IsFocused().
+ Press(keys.Universal.OptionMenu)
+
+ t.Views().Menu().
+ IsFocused().
+ // a string that filters everything out
+ FilterOrSearch("ljasldkjaslkdjalskdjalsdjaslkd").
+ IsEmpty().
+ Press(keys.Universal.Select)
+
+ // back in the files view, selecting the non-existing menu item was a no-op
+ t.Views().Files().
+ IsFocused()
+ },
+})