mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-31 22:24:16 +01:00
fix: serialize managed credential refresh with reads and secret edits
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
feba1f926f
commit
7cf8df553d
7 files changed
+109
-17
No files matched your search
@@ -15,9 +15,10 @@ describe("account quota panels", () => {
|
||||
});
|
||||
it("displays unknown utilization without inventing zero percent", () => {
|
||||
const html = renderToStaticMarkup(<AccountQuotaPanels accounts={[
|
||||
{ provider: "openai", accountKey: "a", ok: true, windows: [{ label: "Credits", usedPercent: null, resetsAt: null, valueLabel: "$5 remaining" }] },
|
||||
{ provider: "openai", accountKey: "a", ok: true, windows: [{ label: "Credits", usedPercent: null, resetsAt: "2026-10-05T00:00:00Z", valueLabel: "$5 remaining" }] },
|
||||
]} />);
|
||||
expect(html).toContain("$5 remaining");
|
||||
expect(html).toContain(`Resets ${new Date("2026-10-05T00:00:00Z").toLocaleString()}`);
|
||||
expect(html).not.toContain("0%");
|
||||
expect(html).not.toContain('role="progressbar"');
|
||||
});
|
||||
|
||||
@@ -27,9 +27,12 @@ export function AccountQuotaPanels({
|
||||
</p>
|
||||
)}
|
||||
{account.windows.map((window, index) => window.usedPercent == null ? (
|
||||
<div key={`${window.label}:${index}`} className="flex justify-between gap-3 text-sm">
|
||||
<span>{window.label}</span>
|
||||
<span className="text-muted-foreground">{window.valueLabel ?? "Usage not reported"}</span>
|
||||
<div key={`${window.label}:${index}`} className="space-y-1 text-sm">
|
||||
<div className="flex justify-between gap-3">
|
||||
<span>{window.label}</span>
|
||||
<span className="text-muted-foreground">{window.valueLabel ?? "Usage not reported"}</span>
|
||||
</div>
|
||||
{window.resetsAt && <p className="text-xs text-muted-foreground">Resets {new Date(window.resetsAt).toLocaleString()}</p>}
|
||||
</div>
|
||||
) : (
|
||||
<QuotaBar
|
||||
|
||||
Reference in new issue
Block a user