{
  "schema": "https://bars.commonsware.com/conformance/schema/render-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "unless-empty-array-renders-body",
      "description": "Empty JsonArray is falsy so {{#unless}} renders its body.",
      "template": "{{#unless items }}empty{{/unless}}",
      "context": {
        "items": []
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "empty"
      }
    },
    {
      "name": "unless-empty-object-renders-else",
      "description": "Empty JsonObject is truthy so {{#unless}} renders its else arm.",
      "template": "{{#unless obj }}empty{{else}}present{{/unless}}",
      "context": {
        "obj": {}
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "present"
      }
    },
    {
      "name": "unless-falsy-renders-body",
      "description": "Identifier resolves to false: the body renders.",
      "template": "{{#unless flag }}no{{/unless}}",
      "context": {
        "flag": false
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "no"
      }
    },
    {
      "name": "unless-jsonnull-renders-body",
      "description": "An explicit JsonNull is falsy so {{#unless}} renders its body.",
      "template": "{{#unless flag }}no{{/unless}}",
      "context": {
        "flag": null
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "no"
      }
    },
    {
      "name": "unless-missing-key-treated-as-falsy",
      "description": "A missing key resolves to null and is treated as falsy: the body renders.",
      "template": "{{#unless absent }}no{{else}}yes{{/unless}}",
      "context": {
        "flag": true
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "no"
      }
    },
    {
      "name": "unless-nested-inside-each",
      "description": "Sanity: {{#unless}} inside {{#each}} suppresses output for truthy items.",
      "template": "{{#each items }}{{#unless skip }}[{{ this/name }}]{{/unless}}{{/each}}",
      "context": {
        "items": [
          {
            "name": "a",
            "skip": false
          },
          {
            "name": "b",
            "skip": true
          },
          {
            "name": "c",
            "skip": false
          }
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "[a][c]"
      }
    },
    {
      "name": "unless-non-empty-array-renders-else",
      "description": "Non-empty JsonArray is truthy: {{#unless}} renders its else arm.",
      "template": "{{#unless items }}empty{{else}}present{{/unless}}",
      "context": {
        "items": [
          1
        ]
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "present"
      }
    },
    {
      "name": "unless-truthy-no-else-emits-nothing",
      "description": "Identifier resolves to true and there is no else arm: emits nothing.",
      "template": "[{{#unless flag }}no{{/unless}}]",
      "context": {
        "flag": true
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "[]"
      }
    },
    {
      "name": "unless-truthy-with-else-renders-else",
      "description": "Identifier resolves to true and an else arm is present: the else arm renders.",
      "template": "{{#unless flag }}no{{else}}yes{{/unless}}",
      "context": {
        "flag": true
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "yes"
      }
    },
    {
      "name": "unless-zero-renders-body",
      "description": "The number 0 is falsy: {{#unless}} renders its body.",
      "template": "{{#unless n }}zero{{/unless}}",
      "context": {
        "n": 0
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "zero"
      }
    }
  ]
}
