fix: add type field to condition test objects
The processMonitorConditions function expects conditions with type: 'expression' field. Fixed test cases to use correct format.
This commit is contained in:
parent
8b145d2522
commit
11f451d7f2
@ -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",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user