testing/cross_backend/rpc_success_fixtures.ts

Success fixtures for the standard spine RPC methods that act on an existing row — revoke a token or a session, delete an invite, revoke a role grant, accept, decline, or retract an offer. The generic round-trip sends nil ids, so on its own it only ever sees these methods refuse with not_found; each fixture here builds the real row through the backend's own RPC surface and returns the params (and, where the row must belong to the caller, the caller's headers) that drive a success response, which describe_rpc_round_trip_tests then validates against the method's output schema on every backend.

Spine-generic: the fixtures use only standard RPC actions and the builtin ROLE_ADMIN, so any consumer mounting create_standard_rpc_actions can pass the map to describe_standard_cross_process_tests (as rpc_success_fixtures) or describe_rpc_round_trip_tests (as success_fixtures). Each fixture mints its own accounts and calls as one of them, so none touches or calls as the suite's shared identities.

view source

Declarations
#

2 declarations

create_spine_rpc_success_fixtures
#

testing/cross_backend/rpc_success_fixtures.ts view source

(options?: SpineRpcSuccessFixturesOptions): RpcSuccessFixtures import {create_spine_rpc_success_fixtures} from '@fuzdev/fuz_app/testing/cross_backend/rpc_success_fixtures.js';

Build the success-fixture map for the standard spine methods that need a real row id: account_token_revoke, account_session_revoke, invite_delete, role_grant_revoke, role_grant_offer_accept, role_grant_offer_decline, and role_grant_offer_retract.

Each factory mints fresh accounts — a fresh ROLE_ADMIN holder as grantor where the setup step is admin-gated — and builds its row as a real client would, then returns the headers of the account that calls: the owner for token and session revoke, accept, decline, and retract; the fresh admin for invite delete and role grant revoke.

options?

the RPC endpoint path

optional default {}

returns

RpcSuccessFixtures

the method → fixture-factory map

SpineRpcSuccessFixturesOptions
#

Depends on
#