# `Macaw.Component.Conformance`
[🔗](https://github.com/dcoai/macaw_component/blob/v0.1.3/lib/macaw/component/conformance.ex#L2)

The component conformance kit (spec/04): the contract and the rendering rules as
checks, so a component author proves conformance by running it.

    defmodule MyApp.CardsConformanceTest do
      use ExUnit.Case, async: true

      use Macaw.Component.Conformance,
        component: MyApp.Cards,
        fixtures: [%{settings: %{"columns" => 2}, deliveries: %{"items" => delivery}}]
    end

**Two layers.** `check(check, component, opts)` answers one check's findings,
`{check, {where, what}}` terms, `[]` for a component that passes; `check(component,
opts)` runs every check, then each check set's; `format/1` words a finding. `use`
writes one test per check. The kit references no ExUnit function itself, so it loads
in production; it is compiled only when `lazy_html` is present.

A check runs the component's callbacks in the caller's process: a raise is the test's
failure, with its stacktrace.

# `finding`

```elixir
@type finding() :: {atom(), {{String.t(), atom() | nil, atom() | nil}, term()}}
```

A finding: the check, then where (the fixture, kind and mode) and what failed.

# `__using__`
*macro* 

Writes one test per check, then per check of each set in `check_sets:`, in a
`describe` block, each failing with its findings. Takes `component:` (required) and the
options of `check/2`.

# `check`

```elixir
@spec check(module(), keyword()) :: [finding()]
```

Every check, then each check set's in `check_sets:`, over a component.

# `check`

```elixir
@spec check(atom(), module(), keyword()) :: [finding()]
```

One check's findings over a component.

# `check_sets`

```elixir
@spec check_sets() :: [atom()]
```

The check sets, in order.

# `checks`

```elixir
@spec checks() :: [atom(), ...]
```

The twelve checks, in order.

# `checks`

```elixir
@spec checks(atom()) :: [atom(), ...]
```

A check set's checks, in order.

# `format`

```elixir
@spec format(finding()) :: String.t()
```

A finding as a line a person reads.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
