1use super::{assert_rendered, before_after, create_element, RenderFn};
2use dodrio::{builder::*, Vdom};
3use futures::prelude::*;
5use wasm_bindgen_test::*;
8fn render_initial_text() {
9 let hello = Rc::new(RenderFn(|_bump| text("hello")));
11 let container = create_element("div");
12 let _vdom = Vdom::new(&container, hello.clone());
13 assert_rendered(&container, &hello);
17fn render_initial_node() {
18 let hello = Rc::new(RenderFn(|bump| {
20 .attr("id", "hello-world")
21 .children([text("Hello "), span(bump).child(text("World!")).finish()])
25 let container = create_element("div");
26 let _vdom = Vdom::new(&container, hello.clone());
27 assert_rendered(&container, &hello);
31fn container_is_emptied_upon_drop() {
32 let container = create_element("div");
33 let vdom = Vdom::new(&container, RenderFn(|_bump| text("blah")));
35 assert!(container.first_child().is_none());
57 replace_text_with_elem {
66 replace_elem_with_text {
84 elems_with_different_tag_names {
93 same_tag_name_update_attribute {
95 div(bump).attr("value", "1").finish()
98 div(bump).attr("value", "2").finish()
102 same_tag_name_remove_attribute {
104 div(bump).attr("value", "1").finish()
111 same_tag_name_add_attribute {
116 div(bump).attr("value", "2").finish()
120 same_tag_name_many_attributes {
123 .attr("before-1", "1")
124 .attr("shared-1", "1")
125 .attr("modified-1", "1")
126 .attr("before-2", "2")
127 .attr("shared-2", "2")
128 .attr("modified-2", "2")
129 .attr("before-3", "3")
130 .attr("shared-3", "3")
131 .attr("modified-3", "3")
136 .attr("after-1", "1")
137 .attr("shared-1", "1")
138 .attr("modified-1", "100")
139 .attr("after-2", "2")
140 .attr("shared-2", "2")
141 .attr("modified-2", "200")
142 .attr("after-3", "3")
143 .attr("shared-3", "3")
144 .attr("modified-3", "300")
149 same_tag_same_children {
151 div(bump).child(text("child")).finish()
154 div(bump).child(text("child")).finish()
158 same_tag_update_child {
160 div(bump).child(text("before")).finish()
163 div(bump).child(text("after")).finish()
172 div(bump).child(text("child")).finish()
176 same_tag_remove_child {
178 div(bump).child(text("child")).finish()
185 same_tag_update_many_children {
206 same_tag_remove_many_children {
225 same_tag_add_many_children {
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list