(page: Page)
| 1350 | } |
| 1351 | |
| 1352 | export async function createOrganization(page: Page): Promise<{ |
| 1353 | name: string; |
| 1354 | displayName: string; |
| 1355 | description: string; |
| 1356 | }> { |
| 1357 | // Create a new organization to test |
| 1358 | await page.goto("/organizations/new", { waitUntil: "domcontentloaded" }); |
| 1359 | const name = randomName(); |
| 1360 | await page.getByLabel("Slug").fill(name); |
| 1361 | const displayName = `Org ${name}`; |
| 1362 | await page.getByLabel("Display name").fill(displayName); |
| 1363 | const description = `Org description ${name}`; |
| 1364 | await page.getByLabel("Description").fill(description); |
| 1365 | await page.getByLabel("Icon", { exact: true }).fill("/emojis/1f957.png"); |
| 1366 | await page.getByRole("button", { name: /save/i }).click(); |
| 1367 | |
| 1368 | await expectUrl(page).toHavePathName(`/organizations/${name}`); |
| 1369 | await expect(page.getByText(/created successfully/)).toBeVisible(); |
| 1370 | |
| 1371 | return { name, displayName, description }; |
| 1372 | } |
| 1373 | |
| 1374 | /** |
| 1375 | * @param organization organization name |
no test coverage detected