Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { EXPORT_PLAN_ROW_CAPS, ExportRowCapExceededError, resolveExportRowCap } from "./limits.js";
|
||||
|
||||
describe("resolveExportRowCap — unknown format fallback", () => {
|
||||
it("falls back to an unbounded format cap for unrecognised formats", () => {
|
||||
// Unknown format -> FORMAT_HARD_CAPS lookup misses -> Infinity fallback;
|
||||
// the enterprise plan is also unbounded, so the effective cap is Infinity.
|
||||
expect(resolveExportRowCap("enterprise", "parquet" as never)).toBe(Number.POSITIVE_INFINITY);
|
||||
});
|
||||
|
||||
it("still applies the plan cap when only the format is unknown", () => {
|
||||
expect(resolveExportRowCap("free", "parquet" as never)).toBe(EXPORT_PLAN_ROW_CAPS.free);
|
||||
});
|
||||
});
|
||||
|
||||
describe("ExportRowCapExceededError message", () => {
|
||||
it("describes an unbounded cap as 'unlimited' rather than 'Infinity'", () => {
|
||||
const error = new ExportRowCapExceededError(100, Number.POSITIVE_INFINITY, "enterprise", "csv");
|
||||
|
||||
expect(error.message).toContain("unlimited");
|
||||
expect(error.message).not.toContain("Infinity");
|
||||
expect(error.code).toBe("EXPORT_ROW_LIMIT_PLAN");
|
||||
});
|
||||
|
||||
it("prints the numeric cap when it is finite", () => {
|
||||
const error = new ExportRowCapExceededError(20_000, 10_000, "free", "csv");
|
||||
|
||||
expect(error.message).toContain("10000");
|
||||
expect(error.message).not.toContain("unlimited");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user