Skip to content

Commit

Permalink
remove internal test for cyclic node refs
Browse files Browse the repository at this point in the history
wasm_bindgen does not yet support #[should_panic]
see also rustwasm/wasm-bindgen#2286
  • Loading branch information
WorldSEnder committed Dec 10, 2022
1 parent 55c0e09 commit 111cb96
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions packages/yew/src/html/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,30 +204,3 @@ mod feat_hydration {
pub fn create_portal(child: Html, host: Element) -> Html {
VNode::VPortal(VPortal::new(child, host))
}

#[cfg(target_arch = "wasm32")]
#[cfg(test)]
mod tests {
use gloo::utils::document;
use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure};

use super::*;

wasm_bindgen_test_configure!(run_in_browser);

#[test]
fn self_linking_node_ref() {
let node: Node = document().create_text_node("test node").into();
let node_ref = NodeRef::new(node.clone());
let node_ref_2 = NodeRef::new(node.clone());

// Link to self
node_ref.link(node_ref.clone());
assert_eq!(node, node_ref.get().unwrap());

// Create cycle of two node refs
node_ref.link(node_ref_2.clone());
node_ref_2.link(node_ref);
assert_eq!(node, node_ref_2.get().unwrap());
}
}

0 comments on commit 111cb96

Please sign in to comment.