mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-13 00:56:25 -04:00
Don't show toasts when running integration tests (#2975)
This commit is contained in:
commit
acfce07aa0
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue