testsuite

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Config

func Config() *runtime.Config

func InsertChannel

func InsertChannel(rt *runtime.Runtime, uuid models.ChannelUUID, orgID models.OrgID, channelType, name, address string, schemes []string, config map[string]any) models.ChannelID

func InsertContact

func InsertContact(rt *runtime.Runtime, orgID models.OrgID, name string) models.ContactID

func InsertIncomingMsg

func InsertIncomingMsg(rt *runtime.Runtime, orgID models.OrgID, channelID models.ChannelID, contactID models.ContactID, urnID models.URNID, text string, createdOn time.Time) models.MsgID

func InsertOrg

func InsertOrg(rt *runtime.Runtime, name string) models.OrgID

func InsertOutgoingMsg

func InsertOutgoingMsg(rt *runtime.Runtime, orgID models.OrgID, channelID models.ChannelID, contactID models.ContactID, urnID models.URNID, text string, createdOn time.Time) models.MsgID

func InsertURN

func InsertURN(rt *runtime.Runtime, orgID models.OrgID, contactID models.ContactID, urn urns.URN) models.URNID

func InsertUser

func InsertUser(rt *runtime.Runtime, email, firstName, lastName, avatar string) models.UserID

func ResetDB

func ResetDB()

func ResetValkey added in v0.3.0

func ResetValkey()

resets our valkey database

func Runtime

func Runtime() (context.Context, *runtime.Runtime)

Runtime returns the various runtime things a test might need

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(t *testing.T, url string) *Client

func (*Client) Close

func (c *Client) Close(t *testing.T)

func (*Client) Read

func (c *Client) Read(t *testing.T) string

func (*Client) Send

func (c *Client) Send(t *testing.T, d string)

type MockCourier

type MockCourier struct {
	Calls []string
	// contains filtered or unexported fields
}

func NewMockCourier

func NewMockCourier(rt *runtime.Runtime) *MockCourier

func (*MockCourier) CreateMsg

func (c *MockCourier) CreateMsg(ctx context.Context, ch *models.Channel, contact *models.Contact, text string) error

func (*MockCourier) ReportDelivered

func (c *MockCourier) ReportDelivered(ctx context.Context, ch *models.Channel, contact *models.Contact, msgID models.MsgID) error

func (*MockCourier) StartChat

func (c *MockCourier) StartChat(ctx context.Context, ch *models.Channel, chatID models.ChatID) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL