]> git.scottworley.com Git - tablify/commitdiff
render_row() test
authorScott Worley <scottworley@scottworley.com>
Wed, 25 Sep 2024 05:40:19 +0000 (22:40 -0700)
committerScott Worley <scottworley@scottworley.com>
Wed, 2 Oct 2024 09:40:47 +0000 (02:40 -0700)
src/lib.rs

index cfaeb4be194b96c5b16faad185e29cbec632b064..47e1d3a9eb1fa10fac60a16cf66153b55d5d725f 100644 (file)
@@ -551,4 +551,21 @@ mod tests {
         render_cell("baz", &mut r);
         assert_eq!(r.entries.len(), 0);
     }
         render_cell("baz", &mut r);
         assert_eq!(r.entries.len(), 0);
     }
+
+    #[test]
+    fn test_render_row() {
+        assert_eq!(
+            render_row(
+                &["foo".to_owned()],
+                &mut Row {
+                    label: "nope".to_owned(),
+                    entries: HashMap::from([("bar".to_owned(), vec![None])]),
+                }
+            ),
+            HTML::from(
+                r#"<tr><th id="nope">nope</th><td class="" onmouseover="h2('nope','foo')" onmouseout="ch2('nope','foo')"></td></tr>
+"#
+            )
+        );
+    }
 }
 }