1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-10-28 04:14:56 +03:00

add popup handler for easier testing

This commit is contained in:
Jesse Duffield
2021-12-06 21:08:36 +11:00
parent 1996eddd91
commit 18283ad41b
6 changed files with 134 additions and 51 deletions

View File

@@ -8,7 +8,7 @@ import (
)
func TestCanDeactivatePopupContextsWithoutViews(t *testing.T) {
contexts := []func(gui *Gui) Context {
contexts := []func(gui *Gui) Context{
func(gui *Gui) Context { return gui.State.Contexts.Credentials },
func(gui *Gui) Context { return gui.State.Contexts.Confirmation },
func(gui *Gui) Context { return gui.State.Contexts.CommitMessage },
@@ -20,7 +20,7 @@ func TestCanDeactivatePopupContextsWithoutViews(t *testing.T) {
context := c(gui)
gui.g = &gocui.Gui{}
gui.deactivateContext(context)
_ = gui.deactivateContext(context)
// This really only checks a prerequisit, not the effect of deactivateContext
view, _ := gui.g.View(context.GetViewName())
@@ -32,7 +32,7 @@ func TestCanDeactivateCommitFilesContextsWithoutViews(t *testing.T) {
gui := NewDummyGui()
gui.g = &gocui.Gui{}
gui.deactivateContext(gui.State.Contexts.CommitFiles)
_ = gui.deactivateContext(gui.State.Contexts.CommitFiles)
// This really only checks a prerequisite, not the effect of deactivateContext
view, _ := gui.g.View(gui.State.Contexts.CommitFiles.GetViewName())