Concrete
GuidesPreview your work

Write an edge-state fixture

The design holds on the property you built it for — and you have no idea what it does on a thin one.

Goal

Fixtures for the states that break a layout: nothing filled, a property that carries almost nothing, a section switched off.

An edge state is one of two things: a property edited down — a copy of a property folder with what it lacks taken out — or a content fixture that states less, or switches something off.

Prerequisites

Steps

Know what concrete check already covers

For every slot of every placed instance, concrete check mints a variant of your first fixture with that one slot emptied and renders it. So the one-empty-slot case is covered whether you write a fixture for it or not, and a marker that disappears when a value does is caught there (render/missing-slot-marker).

What synthesis cannot reach is everything that is a property away: a listing with no photos, a listing with no floor plan to show, a single unlabelled unit, several slots empty at once. Those are what an edge-state fixture is for.

Nothing filled

A content fixture with no content layer at all. Every generative slot resolves to its empty value, and what you see is your template on the day a fill produces nothing:

fixtures/bare-unfilled.json
{
  "$schema": "../.concrete/schema/content-fixture.schema.json",
  "property": "properties/sparse-listing/property.json"
}

Fact-bound slots still resolve — they come from the property — so this is the honest sparse case rather than a blank page. List it in fixtures/index.json, as every fixture is, with its property under properties.

A property that carries little

Build a second fixture on the thin property, filled the way a fill would fill it. Media is a pick of that property's own uploads, so a slot whose brief asks for a photo the property does not carry has nowhere to go — which is the state you came to see:

import { fact, fill, image, section, text } from "@homepages/concrete";

export const Hero = section(
  {
    key: "hero",
    label: "Hero",
    slots: {
      headline: text.medium({
        label: "Headline",
        cap: 60,
        source: fill.write({
          reads: [fact.property.description],
          brief: "Name what makes the property worth seeing. Write one sentence. Confident and specific.",
        }),
      }),
      hero_image: image({
        label: "Hero image",
        from: fact.property.property_media,
        source: fill.pick({ brief: "The photo that best shows the front." }),
      }),
    },
  },
  () => null,
);
fixtures/bare-filled.json
{
  "$schema": "../.concrete/schema/content-fixture.schema.json",
  "property": "properties/sparse-listing/property.json",
  "content": {
    "hero-1": {
      "slots": {
        "headline": "A Shorecrest home with a fireplace living room",
        "hero_image": { "media": "living-room" }
      }
    }
  }
}

A property with something taken out

No property spreads another, so a state the sample library does not carry is a copy, edited. Copy a property's folder to a new one beside it — fixtures/properties/starter/ to fixtures/properties/starter-no-plan/ — and edit its property.json: empty floor_plans, drop the unit's plan, delete the files you no longer name. Then point a content fixture at it:

fixtures/no-floor-plan.json
{
  "$schema": "../.concrete/schema/content-fixture.schema.json",
  "property": "properties/starter-no-plan/property.json"
}

Every reference stays inside the copy's own folder, so the copy carries its own media and nothing it names reaches back into the original (fixtures/reference-invalid).

Missing media and rows are the cases worth writing down, because each one empties a whole list at once: no floor plan, no video, no tour, no document, no comparables, one unit with no label, a contact with a headshot and no logos. A list slot with zero items is not a thinner grid — it is a heading with nothing under it, a carousel with no slides, a count that reads "0 photos". Each of those is a branch in somebody's markup, and an edge fixture is where you find out whether it was written.

A section switched off

An optional section's per-instance display state is part of the content layer, so a content fixture can state it — enabled: false on the instance:

fixtures/hero-off.json
{
  "$schema": "../.concrete/schema/content-fixture.schema.json",
  "property": "properties/starter/property.json",
  "content": {
    "hero-1": { "enabled": false }
  }
}

That renders the page without it — which is what a user gets when they hide the section, and where a neighbouring section's top margin usually turns out to be wrong.

A whole page switched off is not a fixture's to state: an optional page is hidden with the eye in its frame title row in the playground (Use the playground), and what that proves is the navigation, which drops the page for every section that reads it.

Verify

Switch between the edge fixtures in concrete dev and read the page, not the panel: an empty slot should read as a deliberate state, never as a gap where something failed.

Then run concrete check. Every fixture is rendered and graded, so an edge fixture is also a permanent test — media that cannot resolve is render/unresolved-media, and a property that does not satisfy the platform's schema is fixtures/property-invalid.

On this page