mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
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:
parent
87d979d399
commit
50f002048e
3 changed files with 9 additions and 4 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue