testingutils

package
v0.0.38-alpha11 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFamilyMember

func AddFamilyMember(t *testing.T, user1, user2 *models.User)

func AllowOneInlinePrivacyPolicy

func AllowOneInlinePrivacyPolicy(p ent.PrivacyPolicyRule) privacy.InlinePrivacyPolicy

AllowOneInlinePrivacyPolicy wraps AllowOneRule() by an InlinePrivacyPolicy

func AllowOneRule

func AllowOneRule(p ent.PrivacyPolicyRule) []ent.PrivacyPolicyRule

AllowOneRule sandwiches the given rule between an AllowIfOmniscientRule and an AlwaysDenyRule

func AssertEmailSent

func AssertEmailSent(t *testing.T, emailAddress string, emailText string)

func AssertEntLogged

func AssertEntLogged(t *testing.T, ent ent.Entity)

func CreateEdge

func CreateEdge(t *testing.T, edge *ent.AssocEdgeData)

func CreateTestAddress

func CreateTestAddress(t *testing.T, residentNames []string) *models.Address

func CreateTestContact

func CreateTestContact(t *testing.T, user *models.User, allowList ...*models.User) *models.Contact

func CreateTestEvent

func CreateTestEvent(t *testing.T, user *models.User, invitedUsers ...*models.User) *models.Event

func CreateTestUser

func CreateTestUser(t *testing.T) *models.User

func CreateTestUserWithEmail

func CreateTestUserWithEmail(t *testing.T, email string) *models.User

func DefaultCompilerOptions

func DefaultCompilerOptions() string

func DenyOneInlinePrivacyPolicy

func DenyOneInlinePrivacyPolicy(p ent.PrivacyPolicyRule) privacy.InlinePrivacyPolicy

DenyOneInlinePrivacyPolicy wraps DenyOneRule() by an InlinePrivacyPolicy

func DenyOneRule

func DenyOneRule(p ent.PrivacyPolicyRule) []ent.PrivacyPolicyRule

DenyOneRule sandwiches the given rule between an AllowIfOmniscientRule and an AlwaysDenyRule

func EditContact

func EditContact(t *testing.T, contact *models.Contact, fields map[string]interface{}) *models.Contact

func EditEdge

func EditEdge(t *testing.T, edge *ent.AssocEdgeData)

func EditEvent

func EditEvent(t *testing.T, event *models.Event, fields map[string]interface{}) *models.Event

func EditUser

func EditUser(t *testing.T, user *models.User, fields map[string]interface{}) *models.User

func GetAddressBuilder

func GetAddressBuilder(
	operation ent.WriteOperation,
	existingEnt ent.Entity,
) *actions.EntMutationBuilder

func GetBaseBuilder

func GetBaseBuilder(
	operation ent.WriteOperation,
	loader ent.Loader,
	existingEnt ent.Entity,
) *actions.EntMutationBuilder

func GetContactBuilder

func GetContactBuilder(
	operation ent.WriteOperation,
	existingEnt ent.Entity,
) *actions.EntMutationBuilder

func GetDefaultEventFields

func GetDefaultEventFields(user *models.User) map[string]interface{}

func GetDefaultEventFieldsUserID

func GetDefaultEventFieldsUserID(userID string) map[string]interface{}

func GetDefaultUserBuilder

func GetDefaultUserBuilder(email string) *actions.EntMutationBuilder

func GetEventBuilder

func GetEventBuilder(
	operation ent.WriteOperation,
	existingEnt ent.Entity,
) *actions.EntMutationBuilder

func GetEventBuilderwithFields

func GetEventBuilderwithFields(
	operation ent.WriteOperation,
	existingEnt ent.Entity,
	fields map[string]interface{},
) *actions.EntMutationBuilder

func GetUserBuilder

func GetUserBuilder(
	operation ent.WriteOperation,
	existingEnt ent.Entity,
) *actions.EntMutationBuilder

func GetUserBuilderWithFields

func GetUserBuilderWithFields(
	operation ent.WriteOperation,
	existingEnt ent.Entity,
	fields map[string]interface{},
) *actions.EntMutationBuilder

func SaveAddress

func SaveAddress(t *testing.T, b ent.MutationBuilder) *models.Address

func SaveBuilder

func SaveBuilder(t *testing.T, b ent.MutationBuilder)

func SaveContact

func SaveContact(t *testing.T, b ent.MutationBuilder) *models.Contact

func SaveEvent

func SaveEvent(t *testing.T, b ent.MutationBuilder) *models.Event

func SaveUser

func SaveUser(t *testing.T, b ent.MutationBuilder) *models.User

func VerifyEdge

func VerifyEdge(t *testing.T, expectedEdge, edge *ent.AssocEdge)

func VerifyEventObj

func VerifyEventObj(t *testing.T, event *models.Event, user *models.User)

func VerifyEventToCreatorEdge

func VerifyEventToCreatorEdge(t *testing.T, event *models.Event, user *models.User)

func VerifyEventToHostEdge

func VerifyEventToHostEdge(t *testing.T, event *models.Event, user *models.User)

func VerifyFamilyEdge

func VerifyFamilyEdge(t *testing.T, user, user2 *models.User)

func VerifyFriendsEdge

func VerifyFriendsEdge(t *testing.T, user, user2 *models.User)

func VerifyInvitedToEventEdge

func VerifyInvitedToEventEdge(t *testing.T, user *models.User, event *models.Event)

func VerifyNoFamilyEdge

func VerifyNoFamilyEdge(t *testing.T, user, user2 *models.User)

func VerifyNoFriendsEdge

func VerifyNoFriendsEdge(t *testing.T, user, user2 *models.User)

func VerifyNoInvitedToEventEdge

func VerifyNoInvitedToEventEdge(t *testing.T, user *models.User, event *models.Event)

func VerifyNoUserAttendingEventEdge

func VerifyNoUserAttendingEventEdge(t *testing.T, user *models.User, event *models.Event)

func VerifyNoUserDeclinedEventEdge

func VerifyNoUserDeclinedEventEdge(t *testing.T, user *models.User, event *models.Event)

func VerifyNoUserToEventEdge

func VerifyNoUserToEventEdge(t *testing.T, user *models.User, event *models.Event)

func VerifyUserAttendingEventEdge

func VerifyUserAttendingEventEdge(t *testing.T, user *models.User, event *models.Event)

func VerifyUserDeclinedEventEdge

func VerifyUserDeclinedEventEdge(t *testing.T, user *models.User, event *models.Event)

func VerifyUserObj

func VerifyUserObj(t *testing.T, user *models.User, email string)

func VerifyUserToEventEdge

func VerifyUserToEventEdge(t *testing.T, user *models.User, event *models.Event)

Types

type ActionLoggerObserver

type ActionLoggerObserver struct {
	Action actions.Action
}

This is reusable across ent types

func (*ActionLoggerObserver) Observe

func (observer *ActionLoggerObserver) Observe() error

type SendEmailHandler

type SendEmailHandler struct {
	Text  string
	Email string
}

func (*SendEmailHandler) SendEmail

func (s *SendEmailHandler) SendEmail() error

type SendMicroserviceObserver

type SendMicroserviceObserver struct {
}

boo microserv

func (SendMicroserviceObserver) Observe

func (SendMicroserviceObserver) Observe() error

type Suite

type Suite struct {
	suite.Suite
	Tables []string

	ForceClean bool
	// contains filtered or unexported fields
}

func (*Suite) SetupSuite

func (suite *Suite) SetupSuite()

func (*Suite) SetupTest

func (suite *Suite) SetupTest()

func (*Suite) TearDownTest

func (suite *Suite) TearDownTest()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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