test(ui): name the session column fixtures so the inline-object lint budget holds
Some checks failed
ai-gateway image / ai-gateway release image (push) Has been cancelled
LiteLLM Rust / rust-lint (push) Has been cancelled
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
Terraform Modules / fmt, validate, test (aws) (push) Has been cancelled
Terraform Modules / fmt, validate, test (gcp) (push) Has been cancelled

This commit is contained in:
mateo-berri 2026-09-15 16:25:01 -07:00
parent 3441f73118
commit 790c9ab77d

View file

@ -75,14 +75,13 @@ describe("Cost column", () => {
});
it("does not label the per-call spend a session total when the aggregate is unavailable", () => {
renderRows([
logEntry({
request_id: "req-session-no-aggregate",
spend: 0.01,
session_id: "sess-1",
session_total_count: 3,
}),
]);
const rowWithoutAggregate: Partial<LogEntry> = {
request_id: "req-session-no-aggregate",
spend: 0.01,
session_id: "sess-1",
session_total_count: 3,
};
renderRows([logEntry(rowWithoutAggregate)]);
expect(screen.getByText("$0.010000")).toBeInTheDocument();
expect(screen.queryByText("session total")).not.toBeInTheDocument();
@ -90,16 +89,16 @@ describe("Cost column", () => {
});
describe("Duration column", () => {
const sessionRow: Partial<LogEntry> = {
request_id: "req-session-duration",
request_duration_ms: 1200,
session_id: "sess-1",
session_total_count: 3,
};
it("shows the summed session duration, not the representative call's duration, for a multi-round session", () => {
renderRows([
logEntry({
request_id: "req-session-duration",
request_duration_ms: 1200,
session_id: "sess-1",
session_total_count: 3,
session_total_duration_ms: 5400,
}),
]);
const aggregatedRow: Partial<LogEntry> = { ...sessionRow, session_total_duration_ms: 5400 };
renderRows([logEntry(aggregatedRow)]);
expect(screen.getByText("5.40")).toBeInTheDocument();
expect(screen.queryByText("1.20")).not.toBeInTheDocument();
@ -107,29 +106,21 @@ describe("Duration column", () => {
});
it("does not label the per-call duration a session total when the aggregate is unavailable", () => {
renderRows([
logEntry({
request_id: "req-no-aggregate",
request_duration_ms: 1200,
session_id: "sess-3",
session_total_count: 3,
}),
]);
renderRows([logEntry(sessionRow)]);
expect(screen.getByText("1.20")).toBeInTheDocument();
expect(screen.queryByText("session total")).not.toBeInTheDocument();
});
it("shows the call's own duration for a single-call session", () => {
renderRows([
logEntry({
request_id: "req-single-duration",
request_duration_ms: 1200,
session_id: "sess-2",
session_total_count: 1,
session_total_duration_ms: 1200,
}),
]);
const singleCallRow: Partial<LogEntry> = {
...sessionRow,
request_id: "req-single-duration",
session_id: "sess-2",
session_total_count: 1,
session_total_duration_ms: 1200,
};
renderRows([logEntry(singleCallRow)]);
expect(screen.getByText("1.20")).toBeInTheDocument();
});