Skip to content

Commit 100f407

Browse files
style(ui): run prettier --write across the dashboard
Formatting-only pass; no logic changes. Brings the UI into compliance with .prettierrc so the new format-check CI job passes
1 parent 9771f8b commit 100f407

608 files changed

Lines changed: 13619 additions & 16215 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ui/litellm-dashboard/e2e_tests/globalSetup.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ async function globalSetup() {
1414
await page.getByPlaceholder("Enter your username").fill(email);
1515
await page.getByPlaceholder("Enter your password").fill(password);
1616
await page.getByRole("button", { name: "Login", exact: true }).click();
17-
await page.waitForURL(
18-
(url) => url.pathname.startsWith("/ui") && !url.pathname.includes("/login"),
19-
{ timeout: 30_000 },
20-
);
17+
await page.waitForURL((url) => url.pathname.startsWith("/ui") && !url.pathname.includes("/login"), {
18+
timeout: 30_000,
19+
});
2120
await expect(page.locator("a", { hasText: "Virtual Keys" })).toBeVisible({ timeout: 30_000 });
2221
// Dismiss feedback popup if present
2322
const dismiss = page.getByText("Don't ask me again");

ui/litellm-dashboard/e2e_tests/helpers/navigation.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ export async function dismissFeedbackPopup(page: PlaywrightPage): Promise<void>
2020
if (await dismissButton.isVisible({ timeout: 1_500 }).catch(() => false)) {
2121
await dismissButton.click();
2222
// Wait for the popup to disappear
23-
await expect(dismissButton).not.toBeVisible({ timeout: 2_000 }).catch(() => {});
23+
await expect(dismissButton)
24+
.not.toBeVisible({ timeout: 2_000 })
25+
.catch(() => {});
2426
}
2527
}
2628

ui/litellm-dashboard/e2e_tests/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default defineConfig({
3131

3232
/* Slow down actions when SLOWMO=<ms> is set, useful for headed local debugging */
3333
launchOptions: {
34-
slowMo: process.env.SLOWMO ? (parseInt(process.env.SLOWMO, 10) || 0) : 0,
34+
slowMo: process.env.SLOWMO ? parseInt(process.env.SLOWMO, 10) || 0 : 0,
3535
},
3636
},
3737

ui/litellm-dashboard/e2e_tests/tests/auth/logout.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ test.describe("Logout", () => {
1313
// is declared with trigger={["click"]}, so a plain click opens the popup.
1414
await page.getByRole("button", { name: /Account menu/i }).click();
1515

16-
const popup = page.locator(".ant-dropdown:visible").filter({
17-
has: page.locator(".bg-white.rounded-lg.shadow-lg"),
18-
}).first();
16+
const popup = page
17+
.locator(".ant-dropdown:visible")
18+
.filter({
19+
has: page.locator(".bg-white.rounded-lg.shadow-lg"),
20+
})
21+
.first();
1922
await expect(popup).toBeVisible({ timeout: 5_000 });
2023

2124
// Click Logout — the handler clears the auth cookie and navigates via

ui/litellm-dashboard/e2e_tests/tests/auth/proxyLogoutUrl.spec.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ test.describe("PROXY_LOGOUT_URL redirect", () => {
3838
// fetch (/sso/get/ui_settings) resolves. Clicking Logout before that lands
3939
// runs `window.location.href = ""` — a same-origin reload, not a redirect —
4040
// so gate the click on the settings response, not just on first paint.
41-
const settingsLoaded = page.waitForResponse(
42-
(r) => r.url().includes("/sso/get/ui_settings") && r.ok(),
43-
{ timeout: 30_000 },
44-
);
41+
const settingsLoaded = page.waitForResponse((r) => r.url().includes("/sso/get/ui_settings") && r.ok(), {
42+
timeout: 30_000,
43+
});
4544
await page.goto("/ui");
4645
await expect(page.getByText("Virtual Keys")).toBeVisible({ timeout: 15_000 });
4746
await settingsLoaded;
@@ -59,10 +58,7 @@ test.describe("PROXY_LOGOUT_URL redirect", () => {
5958

6059
// handleLogout clears cookies/local storage, then assigns window.location.href.
6160
// Arm the navigation wait before the click so we never miss the redirect.
62-
await Promise.all([
63-
page.waitForURL((url) => url.origin === target.origin, { timeout: 15_000 }),
64-
logout.click(),
65-
]);
61+
await Promise.all([page.waitForURL((url) => url.origin === target.origin, { timeout: 15_000 }), logout.click()]);
6662

6763
// The browser landed on exactly the configured logout URL. Compare normalized
6864
// hrefs (both sides through URL()) so trailing-slash / default-port rewrites the
@@ -74,9 +70,7 @@ test.describe("PROXY_LOGOUT_URL redirect", () => {
7470
// ...and the client-side session cookie is gone (clearTokenCookies ran before
7571
// the redirect). HttpOnly cookies set server-side can't be cleared from JS,
7672
// so scope the check to the JS-managed token the UI is responsible for.
77-
const clientTokensAfter = (await page.context().cookies()).filter(
78-
(c) => c.name === "token" && !c.httpOnly,
79-
);
73+
const clientTokensAfter = (await page.context().cookies()).filter((c) => c.name === "token" && !c.httpOnly);
8074
expect(clientTokensAfter, "client token cookie should be cleared on logout").toHaveLength(0);
8175
});
8276
});

ui/litellm-dashboard/e2e_tests/tests/internal-user/internalUser.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ test.describe("Internal User", () => {
2222
const teamSelect = page.locator(".ant-select", { hasText: "Search or select a team" });
2323
await teamSelect.click();
2424
await page.keyboard.type(E2E_TEAM_CRUD_ALIAS);
25-
await expect(
26-
page.locator(".ant-select-dropdown:visible").getByText(E2E_TEAM_CRUD_ALIAS).first(),
27-
).toBeVisible({ timeout: 5_000 });
25+
await expect(page.locator(".ant-select-dropdown:visible").getByText(E2E_TEAM_CRUD_ALIAS).first()).toBeVisible({
26+
timeout: 5_000,
27+
});
2828
});
2929

3030
test("Team info page omits the Settings tab for non-admin members", async ({ page }) => {
@@ -44,9 +44,9 @@ test.describe("Internal User", () => {
4444

4545
// Anchor on the user's own seeded key so the absence check below cannot
4646
// pass vacuously against an empty table.
47-
await expect(
48-
page.locator("table tbody").getByText(E2E_INTERNAL_USER_KEY_ALIAS).first(),
49-
).toBeVisible({ timeout: 10_000 });
47+
await expect(page.locator("table tbody").getByText(E2E_INTERNAL_USER_KEY_ALIAS).first()).toBeVisible({
48+
timeout: 10_000,
49+
});
5050

5151
// The litellm-dashboard team is the proxy's internal bookkeeping team —
5252
// its keys must never leak into an internal user's Virtual Keys table.

ui/litellm-dashboard/e2e_tests/tests/internal-user/internalUserWithTeams.spec.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import { test, expect } from "@playwright/test";
2-
import {
3-
INTERNAL_USER_STORAGE_PATH,
4-
E2E_TEAM_CRUD_ALIAS,
5-
E2E_TEAM_ORG_ALIAS,
6-
} from "../../constants";
2+
import { INTERNAL_USER_STORAGE_PATH, E2E_TEAM_CRUD_ALIAS, E2E_TEAM_ORG_ALIAS } from "../../constants";
73
import { Page } from "../../fixtures/pages";
84
import { navigateToPage } from "../../helpers/navigation";
95

ui/litellm-dashboard/e2e_tests/tests/internal-viewer/internalViewer.spec.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import { test, expect } from "@playwright/test";
2-
import {
3-
E2E_TEAM_CRUD_ID,
4-
E2E_VIEWER_KEY_ALIAS,
5-
INTERNAL_VIEWER_STORAGE_PATH,
6-
} from "../../constants";
2+
import { E2E_TEAM_CRUD_ID, E2E_VIEWER_KEY_ALIAS, INTERNAL_VIEWER_STORAGE_PATH } from "../../constants";
73
import { Page } from "../../fixtures/pages";
84
import { navigateToPage } from "../../helpers/navigation";
95

ui/litellm-dashboard/e2e_tests/tests/login/internalUserIdentity.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ test.describe("Navbar identity scoping", () => {
2222
await expect(accountButton).toHaveAttribute("aria-label", /Internal User/, { timeout: 5_000 });
2323
await expect(accountButton).toHaveAttribute(
2424
"aria-label",
25-
new RegExp(
26-
`signed in as (${escapeRegExp(E2E_INTERNAL_USER_EMAIL)}|${escapeRegExp(E2E_INTERNAL_USER_ID)})`,
27-
),
25+
new RegExp(`signed in as (${escapeRegExp(E2E_INTERNAL_USER_EMAIL)}|${escapeRegExp(E2E_INTERNAL_USER_ID)})`),
2826
{ timeout: 5_000 },
2927
);
3028

ui/litellm-dashboard/e2e_tests/tests/login/login.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ test("user can log in", async ({ page }) => {
2121

2222
// Filter by the popupRender wrapper class to disambiguate from other
2323
// ant-dropdown popups.
24-
const popup = page.locator(".ant-dropdown:visible").filter({
25-
has: page.locator(".bg-white.rounded-lg.shadow-lg"),
26-
}).first();
24+
const popup = page
25+
.locator(".ant-dropdown:visible")
26+
.filter({
27+
has: page.locator(".bg-white.rounded-lg.shadow-lg"),
28+
})
29+
.first();
2730
await expect(popup).toBeVisible({ timeout: 5_000 });
2831
await expect(popup.getByText("Admin", { exact: true })).toBeVisible({ timeout: 5_000 });
2932
await expect(popup.getByText("default_user_id", { exact: true })).toBeVisible({ timeout: 5_000 });

0 commit comments

Comments
 (0)