testing/entities.ts

Shared test entity factories for Account, Actor, RoleGrant, AuditLogEvent, and RequestContext.

Override types widen branded Uuid fields to string so tests can pass literal ids without per-call-site casts. The factory brands internally.

Uses create_test_* names to avoid collisions with real create_account_with_actor from auth/account_queries.ts.

Declarations
#

9 declarations

view source

create_test_account
#

testing/entities.ts view source

(overrides?: TestAccountOverrides | undefined): Account

Create a test Account with sensible defaults.

overrides?

type TestAccountOverrides | undefined
optional

returns

Account

create_test_actor
#

testing/entities.ts view source

(overrides?: TestActorOverrides | undefined): Actor

Create a test Actor with sensible defaults.

overrides?

type TestActorOverrides | undefined
optional

returns

Actor

create_test_audit_event
#

testing/entities.ts view source

(overrides?: TestAuditEventOverrides | undefined): AuditLogEvent

Create a test AuditLogEvent with sensible defaults.

overrides?

type TestAuditEventOverrides | undefined
optional

returns

AuditLogEvent

create_test_context
#

testing/entities.ts view source

(role_grants?: TestRoleGrantOverrides[]): RequestContext

Create a test RequestContext with role_grants from partial overrides.

role_grants

type TestRoleGrantOverrides[]
default [{}]

returns

RequestContext

create_test_role_grant
#

testing/entities.ts view source

(overrides?: TestRoleGrantOverrides | undefined): RoleGrant

Create a test RoleGrant with sensible defaults.

overrides?

type TestRoleGrantOverrides | undefined
optional

returns

RoleGrant

TestAccountOverrides
#

TestActorOverrides
#

TestAuditEventOverrides
#

TestRoleGrantOverrides
#

Depends on
#

Imported by
#