{
  "schema": "https://bars.commonsware.com/conformance/schema/render-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "where-property-value",
      "spotlight": true,
      "description": "With two arguments, keeps structs whose property equals the value.",
      "template": "{{ items | where: \"k\" \"a\" }}",
      "context": {
        "items": [
          {
            "k": "a",
            "v": 1
          },
          {
            "k": "b",
            "v": 2
          }
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "[{\"k\":\"a\",\"v\":1}]"
      }
    },
    {
      "name": "where-property-truthy",
      "spotlight": true,
      "description": "With one argument, keeps structs whose property is truthy.",
      "template": "{{ items | where: \"on\" }}",
      "context": {
        "items": [
          {
            "on": true,
            "id": 1
          },
          {
            "on": false,
            "id": 2
          }
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "[{\"on\":true,\"id\":1}]"
      }
    },
    {
      "name": "where-no-match-is-empty-list",
      "description": "When nothing matches, the result is an empty list.",
      "template": "{{ items | where: \"k\" \"z\" }}",
      "context": {
        "items": [
          {
            "k": "a"
          }
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "[]"
      }
    },
    {
      "name": "where-non-list-is-null",
      "description": "where operates only on lists; a string input yields null.",
      "template": "{{ x | where: \"k\" }}",
      "context": {
        "x": "hi"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "where-non-struct-contents-is-null",
      "description": "where expects a list of structs; non-struct contents yield null.",
      "template": "{{ xs | where: \"k\" }}",
      "context": {
        "xs": [
          1,
          2
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "where-zero-args-is-error",
      "description": "Zero arguments is an arity error.",
      "template": "{{ items | where }}",
      "context": {
        "items": [
          {
            "k": "a"
          }
        ]
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    },
    {
      "name": "where-three-args-is-error",
      "description": "More than two arguments is an arity error.",
      "template": "{{ items | where: \"k\" \"a\" \"b\" }}",
      "context": {
        "items": [
          {
            "k": "a"
          }
        ]
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    }
  ]
}
