style(e2e): format logs call id helper and spec

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Devin AI 2026-09-22 07:25:28 +00:00
parent 8e422da162
commit b599c7165e
2 changed files with 11 additions and 4 deletions

View file

@ -139,7 +139,7 @@ export async function waitForSpendLog(
lastStatus = res.status();
if (res.ok()) {
const body = await res.json();
const rows = Array.isArray(body) ? body : (body?.data ?? []);
const rows = Array.isArray(body) ? body : body?.data ?? [];
if (rows.length > 0) {
return;
}

View file

@ -102,7 +102,9 @@ test.describe("Logs page", () => {
model: CHAT_MODEL_A,
prompt,
});
expect(callId, "call id must differ from the provider response id for this check to mean anything").not.toBe(requestId);
expect(callId, "call id must differ from the provider response id for this check to mean anything").not.toBe(
requestId,
);
await waitForSpendLog(request, requestId);
await navigateToPage(page, Page.Logs);
@ -113,12 +115,17 @@ test.describe("Logs page", () => {
const row = requestLogsRows(page).filter({ hasText: requestId });
await expect(row, `no logs row for call id ${callId}`).toHaveCount(1, { timeout: 30_000 });
await expect(row, `Logs row for ${requestId} does not display its x-litellm-call-id ${callId}`).toContainText(callId);
await expect(row, `Logs row for ${requestId} does not display its x-litellm-call-id ${callId}`).toContainText(
callId,
);
await row.click();
const drawer = page.getByRole("dialog").first();
await expect(drawer.getByText("Request & Response")).toBeVisible({ timeout: 20_000 });
await expect(drawer.getByText(callId, { exact: false }).first(), `drawer does not show x-litellm-call-id ${callId}`).toBeVisible({ timeout: 10_000 });
await expect(
drawer.getByText(callId, { exact: false }).first(),
`drawer does not show x-litellm-call-id ${callId}`,
).toBeVisible({ timeout: 10_000 });
});
// Split out because only the copy path needs a secure context; folding it in would