test(people): fix e2e selectors for tabs, team picker, and unified form button

This commit is contained in:
2026-06-26 02:13:38 +02:00
parent 84884c3cbf
commit 9ab4804348
+14 -17
View File
@@ -37,27 +37,24 @@ test.describe("people and teams", () => {
}) => {
await signInAsAdmin(page, baseURL)
const sections = page.getByRole("navigation", { name: "People sections" })
await expect(sections).toBeVisible()
await page.goto("/people?tab=people")
await expect(
page.getByRole("navigation", { name: "People sections" }),
).toBeVisible()
await expect(page.getByRole("link", { name: "People" })).toHaveAttribute(
"aria-current",
"page",
)
sections.getByRole("link", { name: "People" }),
).toHaveAttribute("aria-current", "page")
await page.goto("/people?tab=teams")
await expect(page.getByRole("link", { name: "Teams" })).toHaveAttribute(
"aria-current",
"page",
)
await expect(
sections.getByRole("link", { name: "Teams" }),
).toHaveAttribute("aria-current", "page")
await expect(page.getByLabel("Team name")).toBeVisible()
await page.goto("/people?tab=invalid")
await expect(page.getByRole("link", { name: "People" })).toHaveAttribute(
"aria-current",
"page",
)
await expect(
sections.getByRole("link", { name: "People" }),
).toHaveAttribute("aria-current", "page")
})
test("creates, renames, and deletes a team", async ({ baseURL, page }) => {
@@ -106,7 +103,7 @@ test.describe("people and teams", () => {
await page.getByLabel("Email").fill(`e2e-${timestamp}@example.test`)
await page.getByLabel("Phone").fill("123456789")
await page.getByLabel("Role").selectOption("NO_USER")
await page.getByRole("button", { name: "Create Person" }).click()
await page.getByRole("button", { name: "Create User" }).click()
await expect(page.getByText("Person created successfully")).toBeVisible()
await page.goto("/people?tab=people")
@@ -129,11 +126,11 @@ test.describe("people and teams", () => {
await page.goto("/people/new")
await page.getByLabel("First Name").fill(personName)
await page.getByLabel("Last Name").fill("E2E")
await page.getByLabel("Team").selectOption({ label: "" })
await page.getByLabel("Team").selectOption({ value: "" })
await page.getByLabel("Email").fill(`e2e-noteam-${timestamp}@example.test`)
await page.getByLabel("Phone").fill("123456789")
await page.getByLabel("Role").selectOption("NO_USER")
await page.getByRole("button", { name: "Create Person" }).click()
await page.getByRole("button", { name: "Create User" }).click()
await expect(page.getByText("Person created successfully")).toBeVisible()
await page.goto("/people?tab=people")