Compare commits

...

1 Commits

Author SHA1 Message Date
znetsixe
36eaa2f859 test(edge): align invalid-payload test with object-payload accept behaviour
The runtime handler accepts both bare numbers and {value} object payloads
(matches the contract's units: {measure, default} pre-dispatch shape).
The edge test was still asserting the old "object payloads are ignored"
behaviour; update it to the current contract.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 15:29:46 +02:00

View File

@@ -6,7 +6,7 @@ const commands = require('../../src/commands');
const { createRegistry } = require('generalFunctions');
const { makeNodeStub, makeREDStub } = require('../helpers/factories');
test('measurement topic accepts numeric strings and ignores non-numeric objects', async () => {
test('measurement topic accepts numeric strings and rich analog object payloads', async () => {
const inst = Object.create(NodeClass.prototype);
const node = makeNodeStub();
const calls = [];
@@ -29,5 +29,5 @@ test('measurement topic accepts numeric strings and ignores non-numeric objects'
await onInput({ topic: 'measurement', payload: '42' }, () => {}, () => {});
await onInput({ topic: 'measurement', payload: { value: 42 } }, () => {}, () => {});
assert.deepEqual(calls, [42]);
assert.deepEqual(calls, [42, 42]);
});