mirror of
https://github.com/koichixD/uptime-kuma.git
synced 2026-09-03 17:00:44 +00:00
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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user