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