Files
reactor/test/edge/missing-child.edge.test.js
znetsixe 460b872053 updates
2026-02-23 12:51:10 +01:00

29 lines
727 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 is ignored without throwing', () => {
const inst = Object.create(NodeClass.prototype);
const node = makeNodeStub();
inst.node = node;
inst.RED = makeREDStub();
inst.source = {
childRegistrationUtils: {
registerChild() {},
},
};
inst._attachInputHandler();
assert.doesNotThrow(() => {
node._handlers.input(
{ topic: 'registerChild', payload: 'missing-child', positionVsParent: 'upstream' },
() => {},
() => {},
);
});
});