# `Plushie.Test.TreeHash`
[🔗](https://github.com/plushie-ui/plushie-elixir/blob/v0.7.2/lib/plushie/test/tree_hash.ex#L1)

Structural tree hash and golden-file assertions for tests.

# `t`

```elixir
@type t() :: %Plushie.Test.TreeHash{
  backend: Plushie.Automation.backend_mode() | nil,
  hash: String.t(),
  name: String.t()
}
```

# `assert_match`

```elixir
@spec assert_match(tree_hash :: t(), golden_dir :: String.t()) :: :ok
```

Asserts that a tree hash matches its golden file.

# `from_response`

```elixir
@spec from_response(map()) :: t()
```

Builds a tree hash from a renderer `tree_hash_response` message.

# `from_tree`

```elixir
@spec from_tree(
  name :: String.t(),
  tree :: map(),
  backend :: Plushie.Automation.backend_mode() | nil
) :: t()
```

Builds a tree hash from a normalized UI tree.

# `hash`

```elixir
@spec hash(data :: binary()) :: String.t()
```

Computes a SHA-256 hash of the given binary data.

---

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