1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import {GraphState, GraphStateListener} from "./graph_state";
- // import {GraphState} from "./graph_state";
- import {mockUuid} from "./test_helpers";
- import {
- NodeCreation,
- NodeDeletion,
- EdgeCreation,
- EdgeUpdate,
- PrimitiveRegistry,
- } from "./primitive_delta";
- import {
- assert,
- } from "../util/assert";
- // describe("GraphState", () => {
- // // need to test more scenarios!
- // // taken from primitive delta test:
- // it("Delete node with self-edge", () => {
- // const graphState = new GraphState();
- // const registry = new PrimitiveRegistry();
- // // const executor = new GraphState();
- // const getId = mockUuid();
- // const nodeCreation = registry.newNodeCreation(getId());
- // const edgeCreation = registry.newEdgeCreation(nodeCreation, "label", nodeCreation);
- // const edgeUpdate = registry.newEdgeUpdate(edgeCreation, null);
- // const nodeDeletion = registry.newNodeDeletion(nodeCreation, [edgeUpdate], [edgeUpdate]);
- // assert(graphState.nodes.size === 0, "Expected no nodes initially");
- // // assert(graphState.edges.length === 0, "Expected no edges initially");
- // graphState.exec(nodeCreation);
- // assert(graphState.nodes.size === 1, "Expected one node after NodeCreation");
- // // assert(graphState.edges.length === 0, "Expected no edges after NodeCreation");
- // graphState.exec(edgeCreation);
- // assert(graphState.nodes.size === 1, "Expected one node after EdgeCreation");
- // // assert(graphState.edges.length === 1, "Expected one edge after EdgeCreation");
- // graphState.exec(edgeUpdate);
- // assert(graphState.nodes.size === 1, "Expected one node after EdgeUpdate");
- // // assert(graphState.edges.length === 0, "Expected no edges after EdgeUpdate");
- // graphState.exec(nodeDeletion);
- // assert(graphState.nodes.size === 0, "Expected no nodes after NodeDeletion");
- // // assert(graphState.edges.length === 0, "Expected no edges after NodeDeletion");
- // });
- // });
|