diff --git a/core/condition_test.go b/core/condition_test.go index 8d63dced..934c053d 100644 --- a/core/condition_test.go +++ b/core/condition_test.go @@ -561,6 +561,14 @@ func TestCondition_evaluate(t *testing.T) { ExpectedSuccess: true, 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", Condition: Condition("has([BODY].errors) == false"),