Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions rusty/src/core/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,14 @@ mod tests {
assert!(json.to_string().contains("Hello from runtime"));
}

#[tokio::test]
async fn test_runtime_build_populates_tree() {
let mut runtime = Runtime::new(TestView);
assert!(runtime.current_tree().await.is_none());
runtime.build().await;
assert!(runtime.current_tree().await.is_some());
}

#[tokio::test]
async fn test_runtime_build_assigns_ids_automatically() {
use crate::widgets::layout::Layout;
Expand Down
1 change: 1 addition & 0 deletions rusty/src/server/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ async fn handle_socket(socket: WebSocket, state: Arc<AppState>) {
// Send initial render from this session's own runtime
{
let mut session = session_arc.write().await;
session.runtime.build().await;
if let Some(tree) = session.runtime.current_tree().await {
let msg = ServerMessage::Refresh {
widgets: tree.clone(),
Expand Down
Loading