| 1200 | /** An `ExecutorAdmin` that answers everything and records the reads it was |
| 1201 | * asked for, so a test can assert the call the filter chose. */ |
| 1202 | const recordingAdmin = (calls: string[]): ExecutorAdmin => ({ |
| 1203 | listSubjects: (options) => { |
| 1204 | calls.push(`listSubjects:${options?.externalIds?.join(",") ?? "*"}`); |
| 1205 | return Effect.succeed([A_SUBJECT]); |
| 1206 | }, |
| 1207 | getSubject: () => { |
| 1208 | calls.push("getSubject"); |
| 1209 | return Effect.succeed(A_SUBJECT); |
| 1210 | }, |
| 1211 | listSubjectConnections: () => { |
| 1212 | calls.push("listSubjectConnections"); |
| 1213 | return Effect.succeed([]); |
| 1214 | }, |
| 1215 | listSubjectsWithConnections: (options) => { |
| 1216 | calls.push(`listSubjectsWithConnections:${options?.externalIds?.join(",") ?? "*"}`); |
| 1217 | return Effect.succeed([{ ...A_SUBJECT, connections: [] }]); |
| 1218 | }, |
| 1219 | getSubjectWithConnections: () => { |
| 1220 | calls.push("getSubjectWithConnections"); |
| 1221 | return Effect.succeed({ ...A_SUBJECT, connections: [] }); |
| 1222 | }, |
| 1223 | }); |
| 1224 | |
| 1225 | describe("admin users reads — the ?email= filter is applied before the read", () => { |
| 1226 | it.effect("resolves the joined view through the keyed read, never a page scan", () => |