testutil

package
v0.0.0-...-5f8c1fa Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllClients []*httpexpect.Expect
View Source
var AllInstNames []string
View Source
var BaseURL = "http://localhost"
View Source
var Inst1Admin *pgmodels.User
View Source
var Inst1AdminClient *httpexpect.Expect
View Source
var Inst1AdminToken string
View Source
var Inst1User *pgmodels.User
View Source
var Inst1UserClient *httpexpect.Expect
View Source
var Inst1UserToken string
View Source
var Inst2Admin *pgmodels.User
View Source
var Inst2AdminClient *httpexpect.Expect
View Source
var Inst2AdminToken string
View Source
var Inst2User *pgmodels.User
View Source
var Inst2UserClient *httpexpect.Expect
View Source
var Inst2UserToken string
View Source
var SmsUser *pgmodels.User
View Source
var SmsUserClient *httpexpect.Expect
View Source
var SmsUserToken string
View Source
var SysAdmin *pgmodels.User
View Source
var SysAdminClient *httpexpect.Expect
View Source
var SysAdminToken string
View Source
var TokenFor map[*httpexpect.Expect]string
View Source
var UserFor map[*httpexpect.Expect]*pgmodels.User

Functions

func AllInstitutionNames

func AllInstitutionNames(t *testing.T) []string

AllInstitutionNames returns a list of all institution names in our test data, in no guaranteed order. We use this to ensure that pages containing institution lists do indeed display all institutions.

func AllUserNames

func AllUserNames(t *testing.T) []string

AllUserNames returns a list of all user names in our test data, in no guaranteed order. We use this to ensure that pages containing user lists do indeed display all users.

func AssertMatchesAll

func AssertMatchesAll(t *testing.T, body string, items []string)

AssertMatchesAll asserts that all strings in items appear in body.

func AssertMatchesNone

func AssertMatchesNone(t *testing.T, body string, items []string)

AssertMatchesNone asserts that no strings in items appear in body.

func AssertMatchesResultCount

func AssertMatchesResultCount(t *testing.T, body string, count int)

MatchResult count asserts that the result count at the bottom of a list/index page matches the expected count. In the HTML pager, the result count appears in the format "1 - 20 of 215".

func ExtractCSRFToken

func ExtractCSRFToken(t *testing.T, html string) string

Extract csrf token from http response, so we can include it it POST and PUT requests.

func GetAnonymousClient

func GetAnonymousClient(t *testing.T) *httpexpect.Expect

func InitClient

func InitClient(t *testing.T, email string) (*httpexpect.Expect, string)

func InitHTTPTests

func InitHTTPTests(t *testing.T)

func InitUser

func InitUser(t *testing.T, email string) *pgmodels.User

func InstUserNames

func InstUserNames(t *testing.T, institutionID int64) []string

InstUserNames returns the names of all users at an institution.

func OptionLabels

func OptionLabels(options []*forms.ListOption) []string

OptionLabels returns the text labels from a list of HTML options.

Types

This section is empty.

Jump to

Keyboard shortcuts

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