mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-29 04:32:57 +00:00
* fix(usage): keep existing logins visible and explain unavailable quota Credential discovery must preserve accounts whose login exists even when it has expired. Keep vendor failures on the discovered account and isolate discovery failures without inventing provider cards. * test(usage): align credential route tests with account discovery
19 lines
774 B
TypeScript
19 lines
774 B
TypeScript
import { expect, test } from "vitest";
|
|
import { usageCopy } from "./copy";
|
|
|
|
test.each([
|
|
[
|
|
{ kind: "expired", expiresAt: "2026-10-01T09:00:00Z", refreshedBy: "claude" },
|
|
"Login expired 3h ago. Run claude to refresh it.",
|
|
],
|
|
[{ kind: "expired", expiresAt: "2026-10-01T09:00:00Z" }, "Login expired 3h ago. Sign in again."],
|
|
[
|
|
{ kind: "rejected", status: 403, refreshedBy: "codex" },
|
|
"Login rejected (HTTP 403). Run codex to refresh it.",
|
|
],
|
|
[{ kind: "rejected", status: 401 }, "Login rejected (HTTP 401). Sign in again."],
|
|
[{ kind: "no_quota", detail: "No active coding plan" }, "No active coding plan"],
|
|
] as const)("problem %j", (problem, sentence) => {
|
|
expect(usageCopy.problem(problem, new Date("2026-10-01T12:00:00Z"))).toBe(sentence);
|
|
});
|