# `Flicker.Test`
[🔗](https://github.com/team-alembic/flicker/blob/v0.1.0/lib/flicker/test.ex#L1)

A `PhoenixTest` helper for driving `Flicker.select/1` the way a user
would: open the picker, type to filter, pick a result.

Flicker does not depend on `phoenix_test` itself. Add
`{:phoenix_test, "~> 0.5", only: :test}` to your own `mix.exs` to use
this helper (most PhoenixTest users already have it).

# `open_palette`

```elixir
@spec open_palette(struct(), String.t()) :: struct()
```

Opens the palette identified by `palette_id`.

Returns the `session`, ready for `search/3` assertions or `search_select/3`.

# `search`

```elixir
@spec search(struct(), String.t(), String.t()) :: struct()
```

Opens the picker identified by `select_id` and types `query` into it.

Returns the `session` after the provider's asynchronous search completes.
Use this when asserting result-list contents without choosing an option.

# `search_select`

```elixir
@spec search_select(struct(), String.t(), String.t()) :: struct()
```

Opens the picker identified by its required component `id`, types
`option_text` into it to filter, then clicks the resulting option of
the same text.

Returns the `session` for further `PhoenixTest` chaining.

## Example

    session
    |> Flicker.Test.search_select("client-select", "Casey Cassidy")
    |> PhoenixTest.assert_has("#selection", text: "Casey Cassidy")

---

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