before functional changes by codex
This commit is contained in:
28
test/edge/missing-child.edge.test.js
Normal file
28
test/edge/missing-child.edge.test.js
Normal file
@@ -0,0 +1,28 @@
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
|
||||
const NodeClass = require('../../src/nodeClass');
|
||||
const { makeNodeStub, makeREDStub } = require('../helpers/factories');
|
||||
|
||||
test('registerChild with unknown node id currently throws (known robustness gap)', () => {
|
||||
const inst = Object.create(NodeClass.prototype);
|
||||
const node = makeNodeStub();
|
||||
|
||||
inst.node = node;
|
||||
inst.RED = makeREDStub();
|
||||
inst.source = {
|
||||
childRegistrationUtils: {
|
||||
registerChild() {},
|
||||
},
|
||||
};
|
||||
|
||||
inst._attachInputHandler();
|
||||
|
||||
assert.throws(() => {
|
||||
node._handlers.input(
|
||||
{ topic: 'registerChild', payload: 'missing-child', positionVsParent: 'upstream' },
|
||||
() => {},
|
||||
() => {},
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user