(role: "admin" | "member")
| 271 | }); |
| 272 | |
| 273 | const deleteDomain = async (role: "admin" | "member") => { |
| 274 | const deleted: string[] = []; |
| 275 | const app = orgApp(role, workosForCaller(deleted)); |
| 276 | apps.push(app); |
| 277 | const response = await app.handler( |
| 278 | new Request(`https://executor.test/org/domains/${DOMAIN}`, { |
| 279 | method: "DELETE", |
| 280 | headers: { |
| 281 | cookie: `wos-session=sealed; ${await verifiedSettingsCookie(CALLER)}`, |
| 282 | [ORG_SELECTOR_HEADER]: ORG, |
| 283 | }, |
| 284 | }), |
| 285 | // beta.59: the handler type expects a context argument; this layer stack |
| 286 | // needs none at runtime — pass undefined like the api.request-scope tests. |
| 287 | undefined as never, |
| 288 | ); |
| 289 | return { status: response.status, deleted }; |
| 290 | }; |
| 291 | |
| 292 | describe("Org domain handlers over HTTP: the admin gate is the authorized role", () => { |
| 293 | it("lets a mirrored admin delete a domain", async () => { |
no test coverage detected