fix(editor): bound analysis for large source documents

Closes #9208
This commit is contained in:
t8y2 committed 2026-09-26 14:27:19 +00:00
1 parent 94b5856e8d
commit b4f503e1f1
7 files changed
+386 -171

No files matched your search

@@ -0,0 +1,12 @@
import { describe, expect, it } from "vitest";
import { QUERY_EDITOR_FULL_FEATURE_MAX_DOCUMENT_LENGTH, shouldUseQueryEditorLargeDocumentMode } from "@/lib/editor/queryEditorLargeDocument";
describe("query editor large document policy", () => {
it("keeps the default feature set through the configured budget", () => {
expect(shouldUseQueryEditorLargeDocumentMode("x".repeat(QUERY_EDITOR_FULL_FEATURE_MAX_DOCUMENT_LENGTH))).toBe(false);
});
it("switches to bounded features above the configured budget", () => {
expect(shouldUseQueryEditorLargeDocumentMode("x".repeat(QUERY_EDITOR_FULL_FEATURE_MAX_DOCUMENT_LENGTH + 1))).toBe(true);
});
});