mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-25 01:13:40 +01:00
test(condition): Add has-key-of-map
test case
This commit is contained in:
parent
ecc0636a59
commit
19e90cdf31
@ -561,6 +561,14 @@ func TestCondition_evaluate(t *testing.T) {
|
|||||||
ExpectedSuccess: true,
|
ExpectedSuccess: true,
|
||||||
ExpectedOutput: "has([BODY].errors) == false",
|
ExpectedOutput: "has([BODY].errors) == false",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "has-key-of-map",
|
||||||
|
Condition: Condition("has([BODY].article) == true"),
|
||||||
|
Result: &Result{body: []byte("{\n \"article\": {\n \"id\": 123,\n \"title\": \"Hello, world!\",\n \"author\": \"John Doe\",\n \"tags\": [\"hello\", \"world\"],\n \"content\": \"I really like Gatus!\"\n }\n}")},
|
||||||
|
DontResolveFailedConditions: false,
|
||||||
|
ExpectedSuccess: true,
|
||||||
|
ExpectedOutput: "has([BODY].article) == true",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Name: "has-failure",
|
Name: "has-failure",
|
||||||
Condition: Condition("has([BODY].errors) == false"),
|
Condition: Condition("has([BODY].errors) == false"),
|
||||||
|
Loading…
Reference in New Issue
Block a user