Clone in a terminal:
smallcomponent.rs
tests/ - Small test component
#![allow(unreachable_code, dead_code)] #[path = "common.rs"] mod common; use kaja_web::prelude::*; use kaja_web_component::component; use wasm_bindgen_test::*; #[wasm_bindgen_test] fn test_small_component() { common::setup_test(); let content = html! {{ <test-component></test-component> }}; inner_html("#test-div", &content).unwrap(); let element = get_element("test-component").unwrap(); let id = element.id(); assert_ne!(id, ""); let component = Test1Component::get_component(id.as_str()).expect("Component not found in global store"); assert_ne!(component.get_id(), ""); } #[component("test-component")] struct Test1 {} impl Component for Test1Component {} #[wasm_bindgen_test] fn test_nothing_component() { common::setup_test(); let content = html! {{ <nothing-component></nothing-component> }}; inner_html("#test-div", &content).unwrap(); assert!(true); // just to check if it compiles } #[component("nothing-component")] struct Nothing {} impl Component for NothingComponent {}

File history (2 commits)

cfa78a9 Johan Mattsson - johan.mattsson.m@gmail.com
Small test component
Small test component
3d5115c Johan Mattsson - johan.mattsson.m@gmail.com
Another attribute test
Another attribute test

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112