From 79ee9d79886b95b7bf270c6889d7092e9ee06b1e Mon Sep 17 00:00:00 2001 From: Maccesch Date: Sun, 1 Oct 2023 14:04:06 +0100 Subject: [PATCH] fixed portal test --- examples/portal/tests/web.rs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/examples/portal/tests/web.rs b/examples/portal/tests/web.rs index c8ff8ce8b1..6c38c8cb39 100644 --- a/examples/portal/tests/web.rs +++ b/examples/portal/tests/web.rs @@ -4,7 +4,7 @@ use wasm_bindgen_test::*; wasm_bindgen_test_configure!(run_in_browser); use leptos::*; use portal::App; -use web_sys::HtmlElement; +use web_sys::HtmlButtonElement; #[wasm_bindgen_test] fn inc() { @@ -12,7 +12,10 @@ fn inc() { let document = leptos::document(); let div = document.query_selector("div").unwrap().unwrap(); - let show_button = document.get_element_by_id("btn-show").unwrap(); + let show_button = document + .get_element_by_id("btn-show") + .unwrap() + .unchecked_into::(); show_button.click(); @@ -38,7 +41,11 @@ fn inc() { -->" ); - let toggle_button = document.get_element_by_id("btn-toggle").unwrap(); + let toggle_button = document + .get_element_by_id("btn-toggle") + .unwrap() + .unchecked_into::(); + toggle_button.click(); assert_eq!( @@ -62,7 +69,11 @@ fn inc() { -->" ); - let hide_button = document.get_element_by_id("btn-hide").unwrap(); + let hide_button = document + .get_element_by_id("btn-hide") + .unwrap() + .unchecked_into::(); + hide_button.click(); assert_eq!(