diff --git a/yew/src/html/scope.rs b/yew/src/html/scope.rs
index 1eaf5e87f40..70ccee5b64e 100644
--- a/yew/src/html/scope.rs
+++ b/yew/src/html/scope.rs
@@ -336,3 +336,83 @@ where
}
}
}
+
+#[cfg(test)]
+mod tests {
+ use crate::html::*;
+ use crate::Properties;
+ use std::ops::Deref;
+ #[cfg(feature = "wasm_test")]
+ use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure};
+
+ #[cfg(feature = "wasm_test")]
+ wasm_bindgen_test_configure!(run_in_browser);
+
+ #[derive(Clone, Properties)]
+ struct Props {
+ lifecycle: Rc>>,
+ }
+ struct Comp {
+ props: Props,
+ }
+
+ impl Component for Comp {
+ type Message = ();
+ type Properties = Props;
+
+ fn create(props: Self::Properties, _: ComponentLink) -> Self {
+ props.lifecycle.borrow_mut().push("create".into());
+ Comp { props }
+ }
+
+ fn rendered(&mut self, first_render: bool) {
+ self.props
+ .lifecycle
+ .borrow_mut()
+ .push(format!("rendered({})", first_render));
+ }
+
+ fn update(&mut self, _: Self::Message) -> ShouldRender {
+ self.props.lifecycle.borrow_mut().push("update".into());
+ false
+ }
+
+ fn change(&mut self, _: Self::Properties) -> ShouldRender {
+ self.props.lifecycle.borrow_mut().push("change".into());
+ false
+ }
+
+ fn view(&self) -> Html {
+ self.props.lifecycle.borrow_mut().push("view".into());
+ html! {}
+ }
+ }
+
+ impl Drop for Comp {
+ fn drop(&mut self) {
+ self.props.lifecycle.borrow_mut().push("drop".into());
+ }
+ }
+
+ #[test]
+ fn text_mount_in_place() {
+ let document = crate::utils::document();
+ let lifecycle: Rc>> = Rc::default();
+ let props = Props {
+ lifecycle: lifecycle.clone(),
+ };
+
+ let scope = Scope::::new(None);
+ let el = document.create_element("div").unwrap();
+ scope.mount_in_place(el, None, NodeRef::default(), props);
+
+ assert_eq!(
+ lifecycle.borrow_mut().deref(),
+ &vec![
+ "create".to_string(),
+ "view".to_string(),
+ "rendered(true)".to_string()
+ ]
+ );
+ }
+}