From 8f1501d50d3d1a439bc99cca9dea1133f7f3f9a9 Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Mon, 8 Dec 2014 10:07:15 -0500 Subject: [PATCH] added test for #377 --- tests/mithril-tests.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/mithril-tests.js b/tests/mithril-tests.js index 080cb352..3b36aa3c 100644 --- a/tests/mithril-tests.js +++ b/tests/mithril-tests.js @@ -788,6 +788,13 @@ function testMithril(mock) { m.render(root, m("div", [m("div", {key: 1}, 1), m("div", {key: 2}, 2), m("div", {key: 3}, 3), m("div", {key: 4}, 4), m("div", {key: 5}, 5), null, null, null, null, null, null, null, null, null, null])) return root.childNodes[0].childNodes.map(function(c) {return c.childNodes ? c.childNodes[0].nodeValue: c.nodeValue}).slice(0, 5).join("") == "12345" }) + test(function() { + //https://github.com/lhorie/mithril.js/issues/377 + var root = mock.document.createElement("div") + m.render(root, m("div", [m("div", 1), m("div", 2), [m("div", {key: 3}, 3), m("div", {key: 4}, 4), m("div", {key:5}, 5)], [m("div", {key: 6}, 6)]])) + m.render(root, m("div", [m("div", 1), null, [m("div", {key: 3}, 3), m("div", {key: 4}, 4), m("div", {key:5}, 5)], [m("div", {key: 6}, 6)]])) + return root.childNodes[0].childNodes.map(function(c) {return c.childNodes ? c.childNodes[0].nodeValue: c.nodeValue}).slice(0, 5).join("") == "13456" + }) //end m.render //m.redraw