fix: remove cost estim
CI / verify (pull_request) Successful in 9s

This commit is contained in:
2026-09-16 20:30:22 +02:00
parent 693589c21c
commit b4ab44eb3c
6 changed files with 73 additions and 171 deletions
+7 -7
View File
@@ -18,7 +18,6 @@ const status = (plan: string, remaining: number): QuotaStatus => ({
used: 100 - remaining,
resetsAt: 2,
remaining,
sessionConsumed: 1.5,
},
],
});
@@ -32,13 +31,13 @@ test("built quota slot stays reactive across pending, empty, failure, update, an
const { default: plugin } = tui;
const pending = Promise.withResolvers<QuotaStatus | null>();
const responses: Array<() => Promise<QuotaStatus | null>> = [() => pending.promise];
const sessions: string[] = [];
let statusCalls = 0;
let slotRender: SlotRender | undefined;
let notifyUpdated: (() => void) | undefined;
const quota = {
status(input: { sessionID: string }) {
sessions.push(input.sessionID);
status() {
statusCalls++;
const response = responses.shift();
if (!response) throw new Error("Missing test response");
return response();
@@ -84,7 +83,8 @@ test("built quota slot stays reactive across pending, empty, failure, update, an
pending.resolve(status("plus", 75));
await setup.waitForFrame((frame) => frame.includes("ChatGPT quota (plus)"));
expect(setup.captureCharFrame()).toContain("5h: 75% · ~1.5pp · due");
expect(setup.captureCharFrame()).toContain("5h: 75% · due");
expect(setup.captureCharFrame()).not.toContain("~");
responses.push(async () => null);
notifyUpdated();
@@ -94,13 +94,13 @@ test("built quota slot stays reactive across pending, empty, failure, update, an
throw new Error("disconnected");
});
notifyUpdated();
await setup.waitFor(() => sessions.length === 3);
await setup.waitFor(() => statusCalls === 3);
expect(setup.captureCharFrame()).not.toContain("ChatGPT quota");
responses.push(async () => status("pro", 42));
setSessionID("session-two");
await setup.waitForFrame((frame) => frame.includes("ChatGPT quota (pro)"));
expect(sessions).toEqual(["session-one", "session-one", "session-one", "session-two"]);
expect(statusCalls).toBe(4);
} finally {
setup.renderer.destroy();
if (cleanup) await cleanup();