diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-30 16:43:58 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-17 19:13:40 +1100 |
commit | e2f5fe101621c0162791d6ea312ef8093616f59c (patch) | |
tree | 3a019ffcaa01a9807e3645044aea6c8d6b19c410 | |
parent | 182c999ee0ccd845e49d3f5af7845daf683dcfaa (diff) |
pretty sure we can rely on our views existing before our contexts do
-rw-r--r-- | pkg/gui/context_test.go | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/pkg/gui/context_test.go b/pkg/gui/context_test.go deleted file mode 100644 index 3a0aa120a..000000000 --- a/pkg/gui/context_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package gui - -import ( - "testing" - - "github.com/jesseduffield/gocui" - "github.com/jesseduffield/lazygit/pkg/gui/types" - "github.com/stretchr/testify/assert" -) - -func TestCanDeactivatePopupContextsWithoutViews(t *testing.T) { - contexts := []func(gui *Gui) types.Context{ - func(gui *Gui) types.Context { return gui.State.Contexts.Credentials }, - func(gui *Gui) types.Context { return gui.State.Contexts.Confirmation }, - func(gui *Gui) types.Context { return gui.State.Contexts.CommitMessage }, - func(gui *Gui) types.Context { return gui.State.Contexts.Search }, - } - - for _, c := range contexts { - gui := NewDummyGui() - context := c(gui) - gui.g = &gocui.Gui{} - - _ = gui.deactivateContext(context) - - // This really only checks a prerequisit, not the effect of deactivateContext - view, _ := gui.g.View(context.GetViewName()) - assert.Nil(t, view, string(context.GetKey())) - } -} - -func TestCanDeactivateCommitFilesContextsWithoutViews(t *testing.T) { - gui := NewDummyGui() - gui.g = &gocui.Gui{} - - _ = 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()) - assert.Nil(t, view) -} |