chore: import upstream snapshot with attribution
OpenSSF Scorecard / scorecard (push) Failing after 0s
DCO / dco (push) Failing after 0s
CodeQL SAST / analyze (push) Failing after 1s
Deploy Pages / deploy (push) Failing after 1s

This commit is contained in:
wehub-resource-sync
2026-07-13 12:28:05 +08:00
commit 41cb1c0170
1830 changed files with 38276124 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
import { describe, expect, it } from "vitest";
import { formatGraphLimitNotice } from "./GraphTab";
import type { GraphData } from "../lib/types";
describe("formatGraphLimitNotice", () => {
it("reports when the graph response is truncated for render safety", () => {
const data = {
nodes: Array.from({ length: 2000 }, (_, id) => ({
id,
x: 0,
y: 0,
z: 0,
label: "Function",
name: `fn${id}`,
size: 1,
color: "#ffffff",
})),
edges: [],
total_nodes: 43729,
} satisfies GraphData;
expect(formatGraphLimitNotice(data)).toBe(
"Showing 2,000 of 43,729 nodes (0 edges). Raise the node budget or use filters.",
);
});
it("stays quiet when the full graph is rendered", () => {
const data = {
nodes: [],
edges: [],
total_nodes: 0,
} satisfies GraphData;
expect(formatGraphLimitNotice(data)).toBeNull();
});
});