@@ -231,7 +231,8 @@ async function boot(makeDriver: () => Driver, posture: TenancyPosture) {
231231
232232type Rig = Awaited < ReturnType < typeof boot > > ;
233233
234- const sorted = ( xs : readonly string [ ] ) => [ ...xs ] . sort ( ) ;
234+ /** Resolution order is not what is compared: the two faces build different contexts. */
235+ const sorted = ( xs : readonly string [ ] | undefined ) => [ ...( xs ?? [ ] ) ] . sort ( ) ;
235236const crudOf = ( d : ExplainDecision ) => d . layers . find ( ( l ) => l . layer === 'object_crud' ) ?. verdict ;
236237const DENIED = { code : 'PERMISSION_DENIED' , status : 403 } ;
237238
@@ -242,7 +243,7 @@ const DENIED = { code: 'PERMISSION_DENIED', status: 403 };
242243 * precondition asserts.
243244 */
244245function withRig ( makeDriver : ( ) => Driver , posture : TenancyPosture ) {
245- const state : { rig ?: Rig ; warn ?: ReturnType < typeof vi . spyOn > } = { } ;
246+ const state : { rig ?: Rig ; warn ?: { mock : { calls : unknown [ ] [ ] } ; mockRestore : ( ) => void } } = { } ;
246247 beforeAll ( async ( ) => {
247248 state . warn = vi . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => undefined ) ;
248249 state . rig = await boot ( makeDriver , posture ) ;
@@ -255,8 +256,8 @@ function withRig(makeDriver: () => Driver, posture: TenancyPosture) {
255256 rig : ( ) => state . rig ! ,
256257 droppedClaimLines : ( ) =>
257258 ( state . warn ?. mock . calls ?? [ ] )
258- . map ( ( args ) => String ( args [ 0 ] ) )
259- . filter ( ( line ) => line . includes ( 'Session organization claim dropped' ) ) ,
259+ . map ( ( args : unknown [ ] ) => String ( args [ 0 ] ) )
260+ . filter ( ( line : string ) => line . includes ( 'Session organization claim dropped' ) ) ,
260261 } ;
261262}
262263
@@ -268,7 +269,7 @@ describe.each(DRIVERS)('[#20580] %s', (_driver, makeDriver) => {
268269 const removed = await r . rig ( ) . enforce ( USER_REMOVED ) ;
269270 const member = await r . rig ( ) . enforce ( USER_MEMBER ) ;
270271 expect ( removed . tenantId ) . toBeUndefined ( ) ;
271- expect ( r . droppedClaimLines ( ) . some ( ( line ) => line . includes ( USER_REMOVED ) ) ) . toBe ( true ) ;
272+ expect ( r . droppedClaimLines ( ) . some ( ( line : string ) => line . includes ( USER_REMOVED ) ) ) . toBe ( true ) ;
272273 expect ( member . tenantId ) . toBe ( ALPHA ) ;
273274 // The set is resolvable at all: without this, the negative pins below
274275 // would pass for want of a grant, not because the claim was vetted.
0 commit comments