From 11f451d7f2bec2929f07a548e1df494c24a2615d Mon Sep 17 00:00:00 2001 From: mkdev11 Date: Tue, 6 Jan 2026 03:57:34 +0200 Subject: [PATCH] fix: add type field to condition test objects The processMonitorConditions function expects conditions with type: 'expression' field. Fixed test cases to use correct format. --- test/backend-test/monitors/test-mqtt.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/backend-test/monitors/test-mqtt.js b/test/backend-test/monitors/test-mqtt.js index 75d8e1d95..d9b53a8c5 100644 --- a/test/backend-test/monitors/test-mqtt.js +++ b/test/backend-test/monitors/test-mqtt.js @@ -164,6 +164,7 @@ describe("MqttMonitorType", { test("check() sets status to UP when message condition matches (contains)", async () => { const conditions = JSON.stringify([ { + type: "expression", variable: "message", operator: "contains", value: "KEYWORD" @@ -177,6 +178,7 @@ describe("MqttMonitorType", { test("check() sets status to UP when topic condition matches (equals)", async () => { const conditions = JSON.stringify([ { + type: "expression", variable: "topic", operator: "equals", value: "sensors/temp" @@ -189,6 +191,7 @@ describe("MqttMonitorType", { test("check() rejects when message condition does not match", async () => { const conditions = JSON.stringify([ { + type: "expression", variable: "message", operator: "contains", value: "EXPECTED" @@ -203,11 +206,13 @@ describe("MqttMonitorType", { test("check() sets status to UP with multiple conditions (AND)", async () => { const conditions = JSON.stringify([ { + type: "expression", variable: "topic", operator: "equals", value: "test" }, { + type: "expression", variable: "message", operator: "contains", value: "success",