{
  "schema": "https://bars.commonsware.com/conformance/schema/partials-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "partial-block-renders-fallback-when-key-resolves-to-nothing",
      "description": "A static {{#> key }} … {{/>}} partial block whose key matches no inline definition and no loader entry renders its fallback body.",
      "template": "{{#> myPartial }}Failover{{/>}}",
      "partials": {},
      "expect": {
        "kind": "output",
        "expectedOutput": "Failover"
      }
    },
    {
      "name": "partial-block-hit-renders-the-partial-and-discards-the-fallback",
      "description": "When the key resolves against the loader, the resolved partial renders and the fallback body is discarded entirely.",
      "template": "{{#> myPartial }}Failover{{/>}}",
      "partials": {
        "myPartial": "LOADED"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "LOADED"
      }
    },
    {
      "name": "partial-block-renders-fallback-with-no-loader-registered-at-all",
      "description": "Unlike a bare {{> key }} tag, which hard-fails with KB-4002 when no onLoadPartial loader is registered, a partial block with no loader at all (the fixture's partials map is omitted) renders its fallback instead.",
      "template": "{{#> myPartial }}Failover{{/>}}",
      "expect": {
        "kind": "output",
        "expectedOutput": "Failover"
      }
    },
    {
      "name": "partial-block-dynamic-key-hit-renders-the-resolved-partial",
      "description": "A dynamic {{#> (expr) }} key that resolves against the loader renders the resolved partial, discarding the fallback, exactly like the static-key hit case.",
      "template": "{{#> (which) }}Failover{{/>}}",
      "context": {
        "which": "myPartial"
      },
      "partials": {
        "myPartial": "LOADED"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "LOADED"
      }
    },
    {
      "name": "partial-block-dynamic-key-miss-renders-fallback-with-no-soft-fail-reported",
      "description": "A dynamic key that resolves to nothing renders the fallback silently: unlike a bare {{> (expr) }} miss, which reports an UnresolvedReference (KB-5005) soft failure, a partial block's fallback is itself the miss handling, so no soft-fail event is emitted at all.",
      "template": "{{#> (which) }}Failover{{/>}}",
      "context": {
        "which": "missing"
      },
      "partials": {},
      "expect": {
        "kind": "output",
        "expectedOutput": "Failover",
        "softFails": []
      }
    },
    {
      "name": "partial-block-in-scope-inline-definition-shadows-the-loader",
      "description": "An in-scope {{#inline name }} definition wins over a loader entry of the same name, exactly as it does for a bare {{> name }} reference; the fallback is discarded because the inline definition counts as a hit.",
      "template": "{{#inline myPartial }}INLINE{{/inline}}{{#> myPartial }}Failover{{/>}}",
      "partials": {
        "myPartial": "LOADED"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "INLINE"
      }
    },
    {
      "name": "partial-block-context-argument-applies-only-to-the-resolved-partial",
      "description": "The trailing context argument on {{#> key ctx }} pushes ctx as the resolved partial's scope on a hit, exactly like {{> key ctx }}; it has no bearing on the fallback, which is never rendered in this case.",
      "template": "{{#> myPartial person }}Failover{{/>}}",
      "context": {
        "person": {
          "name": "Alice"
        }
      },
      "partials": {
        "myPartial": "{{ name }}"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "Alice"
      }
    },
    {
      "name": "partial-block-fallback-renders-against-the-current-context-not-the-context-argument",
      "description": "On a miss, the fallback is inline template content, not a partial invocation: it renders against the current context, never against the block's context argument, since the context argument only ever applies to the resolved partial on a hit.",
      "template": "{{#> myPartial person }}{{ name }}{{/>}}",
      "context": {
        "name": "Alice",
        "person": {
          "name": "Bob"
        }
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "Alice"
      }
    }
  ]
}
