summaryrefslogtreecommitdiffstats
path: root/pkg/gui
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gui')
-rw-r--r--pkg/gui/controllers/helpers/app_status_helper.go7
-rw-r--r--pkg/gui/gui_common.go4
-rw-r--r--pkg/gui/types/common.go3
3 files changed, 14 insertions, 0 deletions
diff --git a/pkg/gui/controllers/helpers/app_status_helper.go b/pkg/gui/controllers/helpers/app_status_helper.go
index e3b6931ad..a6befe1a2 100644
--- a/pkg/gui/controllers/helpers/app_status_helper.go
+++ b/pkg/gui/controllers/helpers/app_status_helper.go
@@ -21,6 +21,13 @@ func NewAppStatusHelper(c *HelperCommon, statusMgr func() *status.StatusManager)
}
func (self *AppStatusHelper) Toast(message string) {
+ if self.c.RunningIntegrationTest() {
+ // Don't bother showing toasts in integration tests. You can't check for
+ // them anyway, and they would only slow down the test unnecessarily by
+ // two seconds.
+ return
+ }
+
self.statusMgr().AddToastStatus(message)
self.renderAppStatus()
diff --git a/pkg/gui/gui_common.go b/pkg/gui/gui_common.go
index 72662f1c1..e3e288c11 100644
--- a/pkg/gui/gui_common.go
+++ b/pkg/gui/gui_common.go
@@ -182,6 +182,10 @@ func (self *guiCommon) AfterLayout(f func() error) {
}
}
+func (self *guiCommon) RunningIntegrationTest() bool {
+ return self.gui.integrationTest != nil
+}
+
func (self *guiCommon) InDemo() bool {
return self.gui.integrationTest != nil && self.gui.integrationTest.IsDemo()
}
diff --git a/pkg/gui/types/common.go b/pkg/gui/types/common.go
index 0b6a8e430..df927e1b2 100644
--- a/pkg/gui/types/common.go
+++ b/pkg/gui/types/common.go
@@ -107,6 +107,9 @@ type IGuiCommon interface {
// hopefully we can remove this once we've moved all our keybinding stuff out of the gui god struct.
GetInitialKeybindingsWithCustomCommands() ([]*Binding, []*gocui.ViewMouseBinding)
+ // Returns true if we're running an integration test
+ RunningIntegrationTest() bool
+
// Returns true if we're in a demo recording/playback
InDemo() bool
}