29 lines
733 B
JavaScript
29 lines
733 B
JavaScript
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' },
|
|
() => {},
|
|
() => {},
|
|
);
|
|
});
|
|
});
|