+ vec![(2, String::from("baz")), (1, String::from("bar"))]
+ );
+ }
+
+ #[test]
+ fn test_render_cell() {
+ assert_eq!(
+ render_cell(
+ "foo",
+ &RowInput {
+ label: String::from("nope"),
+ entries: vec![]
+ }
+ ),
+ HTML::from("<td class=\"\" onmouseover=\"h2('nope','foo')\" onmouseout=\"ch2('nope','foo')\"></td>")
+ );
+ assert_eq!(
+ render_cell(
+ "foo",
+ &RowInput {
+ label: String::from("nope"),
+ entries: vec![Entry::from("bar")]
+ }
+ ),
+ HTML::from("<td class=\"\" onmouseover=\"h2('nope','foo')\" onmouseout=\"ch2('nope','foo')\"></td>")
+ );
+ assert_eq!(
+ render_cell(
+ "foo",
+ &RowInput {
+ label: String::from("nope"),
+ entries: vec![Entry::from("foo")]
+ }
+ ),
+ HTML::from("<td class=\"yes\" onmouseover=\"h2('nope','foo')\" onmouseout=\"ch2('nope','foo')\"></td>")
+ );
+ assert_eq!(
+ render_cell(
+ "foo",
+ &RowInput {
+ label: String::from("nope"),
+ entries: vec![Entry::from("foo"), Entry::from("foo")]
+ }
+ ),
+ HTML::from("<td class=\"yes\" onmouseover=\"h2('nope','foo')\" onmouseout=\"ch2('nope','foo')\">2</td>")
+ );
+ assert_eq!(
+ render_cell(
+ "foo",
+ &RowInput {
+ label: String::from("nope"),
+ entries: vec![Entry::from("foo: 5"), Entry::from("foo: 10")]
+ }
+ ),
+ HTML::from("<td class=\"yes\" onmouseover=\"h2('nope','foo')\" onmouseout=\"ch2('nope','foo')\">5 10</td>")
+ );
+ assert_eq!(
+ render_cell(
+ "foo",
+ &RowInput {
+ label: String::from("nope"),
+ entries: vec![Entry::from("foo: 5"), Entry::from("foo")]
+ }
+ ),
+ HTML::from("<td class=\"yes\" onmouseover=\"h2('nope','foo')\" onmouseout=\"ch2('nope','foo')\">5 ✓</td>")
+ );
+ assert_eq!(
+ render_cell(
+ "heart",
+ &RowInput {
+ label: String::from("nope"),
+ entries: vec![Entry::from("heart: <3")]
+ }
+ ),
+ HTML::from("<td class=\"yes\" onmouseover=\"h2('nope','heart')\" onmouseout=\"ch2('nope','heart')\"><3</td>")
+ );
+ assert_eq!(
+ render_cell(
+ "foo",
+ &RowInput {
+ label: String::from("bob's"),
+ entries: vec![Entry::from("foo")]
+ }
+ ),
+ HTML::from("<td class=\"yes\" onmouseover=\"h2('bob's','foo')\" onmouseout=\"ch2('bob's','foo')\"></td>")