test

package
v0.0.0-...-6677412 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthorPaging = map[string]interface{}{
	"nodes": Dummy_AuthorList,
	"total": len(Dummy_AuthorList),
}
View Source
var Dummy_AuthorList = []map[string]interface{}{
	{
		"id":         1,
		"created_at": time.Now(),
		"updated_at": time.Now(),
		"deleted_at": nil,
		"email":      "abc@abc.com",
		"kid":        "",
		"first_name": "abc",
		"last_name":  "cba",
		"medium": map[string]interface{}{
			"id": 1,
		},
		"birth_date": time.Now(),
		"gender":     "male",
		"permission": map[string]interface{}{
			"id":              1,
			"created_at":      time.Now(),
			"updated_at":      time.Now(),
			"deleted_at":      nil,
			"user_id":         1,
			"user":            nil,
			"organisation_id": 1,
			"organisation":    nil,
			"role":            "owner",
		},
	},
	{
		"id":         2,
		"created_at": time.Now(),
		"updated_at": time.Now(),
		"deleted_at": nil,
		"email":      "def@def.com",
		"kid":        "",
		"first_name": "def",
		"last_name":  "fed",
		"birth_date": time.Now(),
		"medium": map[string]interface{}{
			"id": 1,
		},
		"gender": "male",
		"permission": map[string]interface{}{
			"id":              2,
			"created_at":      time.Now(),
			"updated_at":      time.Now(),
			"deleted_at":      nil,
			"user_id":         2,
			"user":            nil,
			"organisation_id": 1,
			"organisation":    nil,
			"role":            "member",
		},
	},
}

Functions

func CheckJSON

func CheckJSON(obj *httpexpect.Object, data interface{}, qry string)

func CheckSpaceMock

func CheckSpaceMock(mock sqlmock.Sqlmock)

func ExpectationsMet

func ExpectationsMet(t *testing.T, mock sqlmock.Sqlmock)

ExpectationsMet checks if all the expectations are fulfilled

func KavachMockServer

func KavachMockServer()

func SetupMockDB

func SetupMockDB() sqlmock.Sqlmock

func TestRouter

func TestRouter() http.Handler

Types

type Query

type Query struct {
	Query         string                 `json:"query"`
	Variables     map[string]interface{} `json:"variables"`
	OperationName interface{}            `json:"operationName"`
}

Jump to

Keyboard shortcuts

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