mirror of
https://github.com/coder/coder.git
synced 2026-06-03 13:08:25 +00:00
d9ef6ed8ae
Replace MoreMenu with DropDownMenu component to match update design patterns. Note: This was the result of experimentation using Cursor to make the changes and Claude Code for fixing tests. One key takeaway is that verbose e2e logging, especially benign warnings/errors can confuse Claude Code in running playwright and confirming its work. <img width="201" alt="Screenshot 2025-05-01 at 00 00 52" src="https://github.com/user-attachments/assets/4905582e-902e-4b61-adc8-14cab6bd006b" /> <img width="257" alt="Screenshot 2025-05-01 at 00 01 07" src="https://github.com/user-attachments/assets/5befc420-724a-4c57-9a9d-330a39867fae" /> <img width="270" alt="Screenshot 2025-05-01 at 00 01 20" src="https://github.com/user-attachments/assets/9cbf07cb-7d44-4228-ae6f-216e9f2faed0" /> <img width="224" alt="Screenshot 2025-05-01 at 00 01 30" src="https://github.com/user-attachments/assets/9fe95916-3d9d-4600-9b1f-8a620e152a53" />
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
TypeScript
import { expect, test } from "@playwright/test";
|
|
import { createUser, getCurrentOrgId, setupApiCalls } from "../../api";
|
|
import { login } from "../../helpers";
|
|
import { beforeCoderTest } from "../../hooks";
|
|
|
|
test.beforeEach(async ({ page }) => {
|
|
beforeCoderTest(page);
|
|
await login(page);
|
|
await setupApiCalls(page);
|
|
});
|
|
|
|
test("remove user", async ({ page, baseURL }) => {
|
|
const orgId = await getCurrentOrgId();
|
|
const user = await createUser(orgId);
|
|
|
|
await page.goto(`${baseURL}/users`, { waitUntil: "domcontentloaded" });
|
|
await expect(page).toHaveTitle("Users - Coder");
|
|
|
|
const userRow = page.getByRole("row", { name: user.email });
|
|
await userRow.getByRole("button", { name: "Open menu" }).click();
|
|
const menu = page.getByRole("menu");
|
|
await menu.getByText("Delete…").click();
|
|
|
|
const dialog = page.getByTestId("dialog");
|
|
await dialog.getByLabel("Name of the user to delete").fill(user.username);
|
|
await dialog.getByRole("button", { name: "Delete" }).click();
|
|
|
|
await expect(page.getByText("Successfully deleted the user.")).toBeVisible();
|
|
});
|