Documentation
¶
Overview ¶
Package testsupport4datatug builds the stored state a host test needs to exercise DataTug's protected-project role guard end to end. Hosts import it from tests only: it takes a testing.TB, it never talks to a network, and it creates the project through the same shared-project service a host serves, so a host does not have to import the DataTug domain packages to seed it.
Index ¶
Constants ¶
const ( SpaceID = "protected_project_space" OwnerUID = "protected_project_owner" MemberUID = "protected_project_member" TargetUID = "protected_project_target" OwnerContactID = "owner_contact" MemberContactID = "member_contact" TargetContactID = "target_contact" )
Identifiers of the stored fixture.
Variables ¶
This section is empty.
Functions ¶
func ContactItemRef ¶
ContactItemRef is the linkage item of a fixture contact.
Types ¶
type ProtectedProject ¶
type ProtectedProject struct {
DB dal.DB
ProjectID string
// Business is the trusted native Business reader to hand to
// host4datatug.ProjectRelationshipMutationPolicies.
Business facade4datatug.BusinessSharedProjectOptions
}
ProtectedProject is a Business-admitted protected DataTug project stored in an in-memory database. The Space has three members, each with an active contact: the project owner (who holds the project's owner role, the only one that may manage assignments), a second member and a third member. Only the owner is linked to the project.
func NewProtectedProject ¶
func NewProtectedProject(t testing.TB) *ProtectedProject
NewProtectedProject stores the Space, its three contacts and a Business project created by the owner. It sets the reviewed plan settings through t.Setenv, so the test must not be parallel.
func (*ProtectedProject) ProjectItemRef ¶
func (p *ProtectedProject) ProjectItemRef() coretypes.ItemRef
ProjectItemRef is the stored project's linkage item.