sqs-browse: started working on tests for controllers
This commit is contained in:
parent
fb749aaee2
commit
43680000a8
14 changed files with 305 additions and 39 deletions
21
test/testuictx/testuictx.go
Normal file
21
test/testuictx/testuictx.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package testuictx
|
||||
|
||||
import (
|
||||
"context"
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/lmika/awstools/internal/common/ui/dispatcher"
|
||||
"github.com/lmika/awstools/internal/common/ui/uimodels"
|
||||
)
|
||||
|
||||
func New(ctx context.Context) (context.Context, *TestUIContext) {
|
||||
td := &TestUIContext{}
|
||||
return uimodels.WithContext(ctx, dispatcher.DispatcherContext{td}), td
|
||||
}
|
||||
|
||||
type TestUIContext struct {
|
||||
Messages []tea.Msg
|
||||
}
|
||||
|
||||
func (t *TestUIContext) Send(msg tea.Msg) {
|
||||
t.Messages = append(t.Messages, msg)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue