mirror of
https://github.com/semantica-agi/semantica.git
synced 2026-09-04 04:01:07 +00:00
* fix(explorer): keep small full graphs readable * perf(explorer): avoid redundant realtime edge sync --------- Co-authored-by: Sameer Kadam <sskadam6305@gmail.com>
32 lines
876 B
TypeScript
32 lines
876 B
TypeScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
|
|
import { buildRealtimeEdgeAttributes } from "../src/workspaces/GraphWorkspace/realtimeGraphAttributes.ts";
|
|
|
|
const payload = {
|
|
id: "edge-live",
|
|
source_id: "source",
|
|
target_id: "target",
|
|
type: "related_to",
|
|
properties: {},
|
|
};
|
|
|
|
test("realtime edges retain the active small-graph visibility marker", () => {
|
|
const attributes = buildRealtimeEdgeAttributes(payload, {
|
|
isBidirectional: false,
|
|
isSmallGraph: true,
|
|
});
|
|
|
|
assert.equal(attributes.isSmallGraph, true);
|
|
assert.equal(attributes.edgeVariant, "directional");
|
|
});
|
|
|
|
test("realtime edges do not retain the marker after graph leaves small-graph mode", () => {
|
|
const attributes = buildRealtimeEdgeAttributes(payload, {
|
|
isBidirectional: false,
|
|
isSmallGraph: false,
|
|
});
|
|
|
|
assert.equal(attributes.isSmallGraph, false);
|
|
});
|