MCPcopy Index your code
hub / github.com/hizzgdev/jsmind / testDirectionTypes

Function testDirectionTypes

tests/types/fixtures/typescript-test.ts:336–369  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

334
335// Test direction parameter types (should be string, not number)
336function testDirectionTypes() {
337 const testOptions: JsMindOptions = {
338 container: 'test_container'
339 };
340 const testJm = new jsMind(testOptions);
341
342 const testData: NodeTreeFormat = {
343 meta: { name: 'test', author: 'test', version: '1.0' },
344 format: 'node_tree',
345 data: { id: 'root', topic: 'Test Root' }
346 };
347
348 testJm.show(testData);
349 const testRoot = testJm.get_root();
350
351 if (testRoot) {
352 // Test all valid direction values
353 const leftNode = testJm.add_node(testRoot, 'left_node', 'Left Node', {}, 'left');
354 const centerNode = testJm.add_node(testRoot, 'center_node', 'Center Node', {}, 'center');
355 const rightNode = testJm.add_node(testRoot, 'right_node', 'Right Node', {}, 'right');
356
357 // Test insert methods with direction
358 if (leftNode) {
359 testJm.insert_node_before(leftNode, 'before_left', 'Before Left', {}, 'left');
360 testJm.insert_node_after(leftNode, 'after_left', 'After Left', {}, 'left');
361 }
362
363 // Test move_node with special before_id values
364 if (rightNode) {
365 testJm.move_node(rightNode.id, '_first_', testRoot.id, 'left');
366 testJm.move_node(rightNode.id, '_last_', testRoot.id, 'right');
367 }
368 }
369}
370
371// Test node_overflow option with new 'visible' value
372function testNodeOverflowOptions() {

Callers 1

typescript-test.tsFile · 0.85

Calls 6

showMethod · 0.95
get_rootMethod · 0.95
add_nodeMethod · 0.95
insert_node_beforeMethod · 0.95
insert_node_afterMethod · 0.95
move_nodeMethod · 0.95

Tested by

no test coverage detected