From 1cd6603da01d4e556473fce588fe9afa0dba34c2 Mon Sep 17 00:00:00 2001 From: Greg Johnston Date: Mon, 20 Nov 2023 20:39:19 -0500 Subject: [PATCH] ci(examples): fix portal test (#2051) --- examples/portal/Cargo.toml | 3 ++- examples/portal/tests/web.rs | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/portal/Cargo.toml b/examples/portal/Cargo.toml index c4ed7f641..69ae4f9e2 100644 --- a/examples/portal/Cargo.toml +++ b/examples/portal/Cargo.toml @@ -12,4 +12,5 @@ console_error_panic_hook = "0.1.7" [dev-dependencies] wasm-bindgen-test = "0.3.0" wasm-bindgen = "0.2" -web-sys = "0.3" \ No newline at end of file +web-sys = "0.3" +gloo-timers = { version = "0.3", features = ["futures"] } diff --git a/examples/portal/tests/web.rs b/examples/portal/tests/web.rs index 38b06766d..d22db9ea7 100644 --- a/examples/portal/tests/web.rs +++ b/examples/portal/tests/web.rs @@ -6,8 +6,12 @@ use leptos::*; use portal::App; use web_sys::HtmlButtonElement; +async fn next_tick() { + gloo_timers::future::TimeoutFuture::new(25).await; +} + #[wasm_bindgen_test] -fn portal() { +async fn portal() { let document = leptos::document(); let body = document.body().unwrap(); @@ -24,7 +28,7 @@ fn portal() { show_button.click(); - // next_tick().await; + next_tick().await; // check HTML assert_eq!(