Unified · Split
| @@ -141,11 +141,9 @@ it.effect( · 140 unmodified lines | ||
| 141 | 141 | "returns a deterministic bounded page without source fingerprints or raw diagnostics", |
| 142 | 142 | () => |
| 143 | 143 | Effect.gen(function* () { |
| 144 | − const observed = yield* Ref.make<ReadonlyArray<unknown>>([]); | |
| 145 | 144 | const service = yield* EnvironmentUsageMcpService; |
| 146 | 145 | const result = yield* service.read(scope, input); |
| 147 | 146 | yield* encodeEnvironmentUsageResult(result); |
| 148 | − yield* Ref.update(observed, (values) => [...values, result]); | |
| 149 | 147 | |
| 150 | 148 | expect(result.bucketTotal).toBe(2); |
| 151 | 149 | expect(result.bucketNextCursor).toBe(1); |
| @@ -195,6 +193,16 @@ it.effect( · 43 unmodified lines | ||
| 195 | 193 | expect(result.costMeaning).toBe("api_equivalent_estimate"); |
| 196 | 194 | expect(result.paginationConsistency).toBe("live_summary"); |
| 197 | 195 | expect(result.cacheBehavior).toBe("may_refresh_existing_usage_caches"); |
| 196 | + | |
| 197 | + const nextCursor = result.bucketNextCursor ?? assert.fail("expected a second bucket page"); | |
| 198 | + const secondPage = yield* service.read(scope, { ...input, bucketCursor: nextCursor }); | |
| 199 | + yield* encodeEnvironmentUsageResult(secondPage); | |
| 200 | + expect(secondPage).toMatchObject({ | |
| 201 | + bucketCursor: 1, | |
| 202 | + bucketNextCursor: null, | |
| 203 | + bucketTotal: 2, | |
| 204 | + buckets: [{ day: "2026-08-02", provider: "codex", model: { text: "z-model" } }], | |
| 205 | + }); | |
| 198 | 206 | }).pipe(Effect.provide(serviceLayer(() => Effect.succeed(summary)))), |
| 199 | 207 | ); |
| 200 | 208 | |