diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2024-01-12 08:12:39 +0100 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2024-01-14 17:42:03 +0100 |
commit | 9fa43394fed0aaa1114798decb814ebddc9eddc8 (patch) | |
tree | 7b7b5ebc6235b8e8baeb6a19b2c601fad5e6d242 /pkg/gui/gui_driver.go | |
parent | 37590a495c1fd965719bf14d79edf945ff078c3c (diff) |
Make it possible to handle toasts in integration tests
Use it in two selected tests to demonstrate what it looks like.
Diffstat (limited to 'pkg/gui/gui_driver.go')
-rw-r--r-- | pkg/gui/gui_driver.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/gui/gui_driver.go b/pkg/gui/gui_driver.go index c36e68e93..ddeb3fab4 100644 --- a/pkg/gui/gui_driver.go +++ b/pkg/gui/gui_driver.go @@ -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 + } +} |