1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! WASM frontend testing utilities.
//!
//! This module provides comprehensive testing utilities for WASM-based
//! frontend applications built with reinhardt-pages.
//!
//! # Features
//!
//! - **DOM Query API**: Testing Library-style element queries (`get_by_role`, `get_by_text`, etc.)
//! - **Event Simulation**: User interaction simulation (`click`, `type_text`, `keyboard_press`)
//! - **Async Utilities**: Wait helpers (`wait_for`, `sleep`, `flush_effects`)
//! - **Assertions**: DOM state assertions (`should_be_visible`, `should_have_text`)
//! - **Mock Infrastructure**: Server function and browser API mocking
//!
//! # Example
//!
//! ```rust,ignore
//! use reinhardt_test::wasm::{Screen, UserEvent, wait_for};
//! use reinhardt_test::wasm::assertions::ElementAssertions;
//! use wasm_bindgen_test::*;
//!
//! wasm_bindgen_test_configure!(run_in_browser);
//!
//! #[wasm_bindgen_test]
//! async fn test_counter() {
//! let screen = Screen::new();
//!
//! // Find and click button
//! let button = screen.get_by_role("button").get();
//! UserEvent::click(&button);
//!
//! // Wait for update and verify
//! wait_for(|| screen.get_by_text("Count: 1").query().is_some())
//! .await
//! .unwrap();
//!
//! screen.get_by_role("heading").get().should_have_text("Count: 1");
//! }
//! ```
// Re-export all public items
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
// Re-export wasm-bindgen-test for convenience
pub use *;