mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-12-04 10:34:55 +02:00
Add test for crashing on empty menu
This commit is contained in:
parent
373f24c80f
commit
932e01b41a
@ -211,6 +211,7 @@ var tests = []*components.IntegrationTest{
|
|||||||
tag.Reset,
|
tag.Reset,
|
||||||
ui.Accordion,
|
ui.Accordion,
|
||||||
ui.DoublePopup,
|
ui.DoublePopup,
|
||||||
|
ui.EmptyMenu,
|
||||||
ui.SwitchTabFromMenu,
|
ui.SwitchTabFromMenu,
|
||||||
undo.UndoCheckoutAndDrop,
|
undo.UndoCheckoutAndDrop,
|
||||||
undo.UndoDrop,
|
undo.UndoDrop,
|
||||||
|
31
pkg/integration/tests/ui/empty_menu.go
Normal file
31
pkg/integration/tests/ui/empty_menu.go
Normal file
@ -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()
|
||||||
|
},
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user