mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Make it possible to handle toasts in integration tests
Use it in two selected tests to demonstrate what it looks like.
This commit is contained in:
@ -20,6 +20,7 @@ import (
|
||||
type GuiDriver struct {
|
||||
gui *Gui
|
||||
isIdleChan chan struct{}
|
||||
toastChan chan string
|
||||
}
|
||||
|
||||
var _ integrationTypes.GuiDriver = &GuiDriver{}
|
||||
@ -133,3 +134,12 @@ func (self *GuiDriver) SetCaptionPrefix(prefix string) {
|
||||
self.gui.setCaptionPrefix(prefix)
|
||||
self.waitTillIdle()
|
||||
}
|
||||
|
||||
func (self *GuiDriver) NextToast() *string {
|
||||
select {
|
||||
case t := <-self.toastChan:
|
||||
return &t
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user