From 36eaa2f85941b99d86cf687267c6685075771a1d Mon Sep 17 00:00:00 2001 From: znetsixe Date: Sat, 23 May 2026 15:29:46 +0200 Subject: [PATCH] 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) --- test/edge/invalid-payload.edge.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/edge/invalid-payload.edge.test.js b/test/edge/invalid-payload.edge.test.js index 51a12c6..843868d 100644 --- a/test/edge/invalid-payload.edge.test.js +++ b/test/edge/invalid-payload.edge.test.js @@ -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]); });