Alva.Test (Alva v0.1.0)

Copy Markdown View Source

Provides test helpers for verifying Alva dispatch events.

Use these macros in your Phoenix ConnCase or LiveViewCase tests to assert that dispatches succeed or return forbidden errors.

Summary

Functions

Executes an event dispatch and asserts that the result is a forbidden error. Returns the error result map.

Executes an event dispatch and asserts that the result is successful. Returns the successful result map.

Functions

assert_dispatch_forbidden(socket, event, params \\ %{}, opts \\ [])

(since 0.1.0) (macro)

Executes an event dispatch and asserts that the result is a forbidden error. Returns the error result map.

assert_dispatch_ok(socket, event, params \\ %{}, opts \\ [])

(since 0.1.0) (macro)

Executes an event dispatch and asserts that the result is successful. Returns the successful result map.