novdom_testing/testing

Types

pub opaque type Callee

Functions

pub fn call_callee(callee: Callee) -> Nil

Call a callee to later check if it was called (see callee_count). Use this function to simulate a function call.

pub fn callee_count(callee: Callee) -> Int

Check how often a callee was called

pub fn create_callee() -> Callee

Create a callee type that can be used to test if a function was called

pub fn description(
  component: Component,
  desc: String,
) -> Component

Set a description for a component to be used in error messages

pub fn init(test_fn: fn() -> a) -> Nil
pub fn render(component: fn() -> Component) -> Nil
pub fn step(component: Component, step: String) -> Component
pub fn trigger_event(
  component: Component,
  listener: fn(fn(Event) -> Nil) -> Parameter,
) -> Component

Trigger an event on a component.

Example to trigger a click event:

trigger_event(my_component, onclick)
pub fn trigger_unrender(component: Component) -> Component
Search Document