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}}]
endTwo 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.
Summary
Functions
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.
Every check, then each check set's in check_sets:, over a component.
One check's findings over a component.
The check sets, in order.
The twelve checks, in order.
A check set's checks, in order.
A finding as a line a person reads.
Types
Functions
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.
Every check, then each check set's in check_sets:, over a component.
One check's findings over a component.
@spec check_sets() :: [atom()]
The check sets, in order.
@spec checks() :: [atom(), ...]
The twelve checks, in order.
A check set's checks, in order.
A finding as a line a person reads.