testing/cross_backend/actor_lookup.ts

Cross-backend parity suite for actor_lookup.

actor_lookup is an opt-in batched id → label resolver ({ids} → {actors: [{id, username, display_name?}]}), not folded into the standard bundle. It's live-mounted on the spine RPC path but kept off the declared surface (create_spine_surface_spec) — like cells / ws / sse — so the standard cross suite's generic round-trip never drives it; this dedicated suite is its validator. Three cases over raw transport calls:

  • anonymous → 401 — the account-grain auth gate refuses an unauthenticated caller before the handler runs.
  • keeper resolves own actor → 200 — the populated round trip: the returned row carries the keeper's id + username, and no account_id / email / timestamp / role field (the wire shape's deliberate info-leak posture). This is the assertion that exercises the Rust row→JSON mapping against the TS canonical shape.
  • empty ids → 400 — the min(1) input bound is enforced on both spines (TS Zod, Rust parse_ids).

Runs both legs via the shared {setup_test} protocol: the in-process leg (auth/actor_lookup_parity.db.test.ts, plain gro test) and the cross-process leg (cross_backend/actor_lookup.cross.test.ts, the TS spine binaries + Rust testing_spine_stub over real HTTP). actor_lookup is mounted on every spine, so the suite is ungated.

$lib-free by contract (relative specifiers only), like the sibling cross-backend suites.

view source

Declarations
#

2 declarations

ActorLookupCrossTestOptions
#

testing/cross_backend/actor_lookup.ts view source

RpcPathCrossSuiteOptions import type {ActorLookupCrossTestOptions} from '@fuzdev/fuz_app/testing/cross_backend/actor_lookup.js';

Options for the actor-lookup parity suite. The standard RPC-dispatched cross-suite shape (setup_test / capabilities / rpc_path); aliases the shared RpcPathCrossSuiteOptions rather than minting a duplicate.

rpc_path?

RPC endpoint path the methods are mounted on. Default /api/rpc.

type string

readonly

setup_test

Per-test fixture-producing function (fresh keeper + db per call).

type (): Promise<TestFixtureBase>

readonly
returns Promise<TestFixtureBase>

capabilities

Backend capability declarations — each suite gates on its own flag.

type BackendCapabilities

readonly

describe_actor_lookup_cross_tests
#

Depends on
#