Skip to main content

Module testing

Module testing 

Source
Expand description

Test factory helpers for widget extension authors.

Provides TestEnv for setting up a render environment and node / node_with_props / node_with_children for constructing test tree nodes.

§Example

use toddy_core::testing::*;
use toddy_core::prelude::*;

let test = TestEnv::default();
let env = test.env();
let element = my_extension.render(&node, &env);

Structs§

TestEnv
Owns all the dependencies needed to construct a WidgetEnv for testing extension render() methods.

Functions§

node
Create a minimal TreeNode with empty props and no children.
node_with_children
Create a TreeNode with children and empty props.
node_with_props
Create a TreeNode with the given props and no children.