fix(ui): scope the remaining e2e nav lookups to the new sidebar

login and internalUserIdentity used an unscoped "Virtual Keys" text check that now also matches the top-bar breadcrumb, and adminSettings navigated via antd menuitem roles the shadcn nav no longer emits. Scope these to the sidebar's complementary landmark and drive the Settings group by role (expand the button, then click the child link), matching the fixes already applied to the migration and navigation specs
This commit is contained in:
Yuneng Jiang 2026-07-10 12:27:34 -07:00
parent 87d979d399
commit 50f002048e
No known key found for this signature in database
3 changed files with 9 additions and 4 deletions

View file

@ -14,7 +14,8 @@ test.describe("Navbar identity scoping", () => {
test("Internal user navbar dropdown shows their own role and user id, not the admin's", async ({ page }) => {
await page.goto("/ui");
await expect(page.getByText("Virtual Keys")).toBeVisible({ timeout: 10_000 });
// Scope to the sidebar; the top-bar breadcrumb also shows "Virtual Keys".
await expect(page.getByRole("complementary").getByText("Virtual Keys")).toBeVisible({ timeout: 10_000 });
// The account menu button carries the user's role and email/id in its
// aria-label (see UserDropdown.tsx). Match by partial role.

View file

@ -9,7 +9,8 @@ test("user can log in", async ({ page }) => {
const loginButton = page.getByRole("button", { name: "Login", exact: true });
await expect(loginButton).toBeEnabled();
await loginButton.click();
await expect(page.getByText("Virtual Keys")).toBeVisible();
// Scope to the sidebar; the top-bar breadcrumb also shows "Virtual Keys".
await expect(page.getByRole("complementary").getByText("Virtual Keys")).toBeVisible();
// Match the navbar account button by its stable aria-label (UserDropdown.tsx
// emits "Account menu — <role> — signed in as <email|id>"). Earlier this used

View file

@ -6,8 +6,11 @@ test.describe("Add Model", () => {
test("admin settings test", async ({ page }) => {
await page.goto("/ui");
await page.getByRole("menuitem", { name: /Settings/ }).click();
await page.getByRole("menuitem", { name: /Admin Settings/ }).click();
// "Settings" is a collapsible group (button) in the sidebar; expand it, then
// click the "Admin Settings" child link. Scope to the complementary landmark.
const sidebar = page.getByRole("complementary");
await sidebar.getByRole("button", { name: /Settings/ }).click();
await sidebar.getByRole("link", { name: /Admin Settings/ }).click();
await page.getByRole("tab", { name: "UI Settings" }).click();
await expect(page.getByText("Configuration for UI-specific")).toBeVisible();
});