Files
reactor/test/edge/missing-child.edge.test.js

29 lines
727 B
JavaScript
Raw Normal View History

2026-02-19 17:37:42 +01:00
const test = require('node:test');
const assert = require('node:assert/strict');
const NodeClass = require('../../src/nodeClass');
const { makeNodeStub, makeREDStub } = require('../helpers/factories');
2026-02-23 12:51:10 +01:00
test('registerChild with unknown node id is ignored without throwing', () => {
2026-02-19 17:37:42 +01:00
const inst = Object.create(NodeClass.prototype);
const node = makeNodeStub();
inst.node = node;
inst.RED = makeREDStub();
inst.source = {
childRegistrationUtils: {
registerChild() {},
},
};
inst._attachInputHandler();
2026-02-23 12:51:10 +01:00
assert.doesNotThrow(() => {
2026-02-19 17:37:42 +01:00
node._handlers.input(
{ topic: 'registerChild', payload: 'missing-child', positionVsParent: 'upstream' },
() => {},
() => {},
);
});
});