fix(activity): a run's quota reads with its unit, its outcome keeps room at a large text size, a token's audit rows read in Hungarian

The run list showed the quota spend as a bare figure and, at the largest text size on a 1024-wide
screen, its fixed columns left the outcome column no width at all. The outcome now keeps 10rem and
the trigger column gives way; the audit list's summary keeps the same floor. A run that stored no
log line says so instead of linking to an empty list. An API token revoke and a token's file work
rendered the server's English line under the Hungarian UI; both are rebuilt in the reader's
language, and the test holds the server's wording.
This commit is contained in:
2026-10-18 04:22:52 +02:00
parent c288ba147b
commit 3021be5166
9 changed files with 91 additions and 7 deletions
@@ -214,6 +214,37 @@ describe("Activity", () => {
expect(cells("timed")).not.toContain("—");
});
// A bare "212" in a row reads as nothing in particular: the spend carries its unit, and a run that
// spent none says nothing rather than "0".
it("a run's quota spend reads with its unit, and none spent leaves the cell blank", async () => {
window.history.replaceState(null, "", "/?page=activity");
runsMock.mockResolvedValue(
page([
{ ...RUN, id: 1, status: "ok", error: null, summary: "spent" },
{ ...RUN, id: 2, status: "ok", error: null, summary: "free", quota_units: 0 },
]),
);
renderPage();
await waitFor(() => expect(screen.getByText("spent")).toBeTruthy());
const cells = (text: string) =>
[...rowButton(new RegExp(text)).children].map((c) => c.textContent);
expect(cells("spent")).toContain("activity.runs.units");
expect(cells("spent")).not.toContain("212");
expect(cells("free")).not.toContain("0");
expect(cells("free")).not.toContain("activity.runs.units");
});
// Most runs store no line at all: a link there would only lead to an empty list.
it("a run that logged nothing says so instead of linking to an empty list", async () => {
window.history.replaceState(null, "", "/?page=activity");
runsMock.mockResolvedValue(page([{ ...RUN, log_lines: 0 }]));
renderPage();
await waitFor(() => expect(screen.getByText("quotaExceeded")).toBeTruthy());
fireEvent.click(rowButton(/quotaExceeded/));
expect(screen.getByText("activity.runs.noLogLines")).toBeTruthy();
expect(screen.queryByRole("button", { name: "activity.runs.logLines" })).toBeNull();
});
it("a failed read is an error with a retry, not an empty list", async () => {
window.history.replaceState(null, "", "/?page=activity");
runsMock.mockRejectedValue(new Error("502"));