(target: TargetShape, identity: Identity, name: string)
| 87 | |
| 88 | /** Rename the identity's active org through the product's own settings route. */ |
| 89 | const renameOrg = (target: TargetShape, identity: Identity, name: string): Effect.Effect<void> => |
| 90 | Effect.promise(async () => { |
| 91 | const response = await fetch(new URL("/api/account/name", target.baseUrl), { |
| 92 | method: "PATCH", |
| 93 | headers: { |
| 94 | ...identity.headers, |
| 95 | origin: new URL(target.baseUrl).origin, |
| 96 | "content-type": "application/json", |
| 97 | }, |
| 98 | body: JSON.stringify({ name }), |
| 99 | }); |
| 100 | if (!response.ok) throw new Error(`/api/account/name failed (${response.status})`); |
| 101 | await response.body?.cancel(); |
| 102 | }); |
| 103 | |
| 104 | const noticeOf = (page: Page) => page.getByRole("dialog"); |
| 105 |
no test coverage detected