Skip to content

Commit 4160402

Browse files
test(usage): drop redundant Grok decode test and restating comments
AI-assisted; verified with the tests and tools listed above.
1 parent 94a0d51 commit 4160402

3 files changed

Lines changed: 0 additions & 36 deletions

File tree

‎apps/server/src/provider/GrokProvider.test.ts‎

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -642,40 +642,6 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("readGrokAccount"
642642
}).pipe(Effect.scoped),
643643
);
644644

645-
it.effect("keeps the billing period start when decoding the response", () =>
646-
readGrokAccount({
647-
GROK_AUTH: '{"https://accounts.x.ai/sign-in":{"key":"session-token"}}',
648-
}).pipe(
649-
Effect.provideService(
650-
FileSystem.FileSystem,
651-
FileSystem.makeNoop({ readFileString: () => Effect.succeed("") }),
652-
),
653-
Effect.provideService(
654-
HttpClient.HttpClient,
655-
HttpClient.make((request) =>
656-
Effect.succeed(
657-
HttpClientResponse.fromWeb(
658-
request,
659-
Response.json({
660-
config: {
661-
creditUsagePercent: 4,
662-
currentPeriod: {
663-
type: "USAGE_PERIOD_TYPE_WEEKLY",
664-
start: "2026-10-14T20:51:37.352+00:00",
665-
end: "2026-10-21T20:51:37.352+00:00",
666-
},
667-
},
668-
}),
669-
),
670-
),
671-
),
672-
),
673-
Effect.tap(({ usageLimits }) =>
674-
Effect.sync(() => expect(usageLimits.windows[0]?.windowDurationMins).toBe(7 * 24 * 60)),
675-
),
676-
),
677-
);
678-
679645
it.effect(
680646
"uses GROK_AUTH without reading stored credentials and accepts the legacy login scope",
681647
() =>

‎packages/provider-cursor/src/server/usageLimits.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ describe("Cursor usage limits", () => {
4949
{ billingCycleStart, billingCycleEnd, planUsage },
5050
checkedAt,
5151
).windows.map((window) => window.windowDurationMins);
52-
// A 30-day cycle and a 31-day cycle, from real start and end timestamps.
5352
expect(durations("1794045847072", "1796637847072")).toEqual([43_200, 43_200, 43_200]);
5453
expect(durations(1_796_637_847_072, "1799316247072")).toEqual([44_640, 44_640, 44_640]);
5554
});

‎packages/provider-cursor/src/server/usageLimits.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export function cursorUsageResponseToLimits(
3737
Number(response.billingCycleEnd) > 0 && Option.isSome(reset)
3838
? DateTime.formatIso(reset.value)
3939
: undefined;
40-
// The pace badge and even-spend marker need the cycle length, which is end - start.
4140
const cycleStart = Number(response.billingCycleStart);
4241
const windowDurationMins =
4342
resetsAt && cycleStart > 0

0 commit comments

Comments
 (0)