diff --git a/render/tests/test-hyperscript.js b/render/tests/test-hyperscript.js index e24b034f..07d70281 100644 --- a/render/tests/test-hyperscript.js +++ b/render/tests/test-hyperscript.js @@ -3,6 +3,12 @@ var m = require("../../render/hyperscript") o.spec("hyperscript", function() { o.spec("selector", function() { + o("throws on null selector", function(done) { + try {m(null)} catch(e) {done()} + }) + o("throws on non-string selector w/o a view property", function(done) { + try {m({})} catch(e) {done()} + }) o("handles tag in selector", function() { var vnode = m("a") @@ -159,6 +165,13 @@ o.spec("hyperscript", function() { o(vnode.tag).equals("div") o(vnode.attrs.a).equals(false) }) + o("handles only key in attrs", function() { + var vnode = m("div", {key:"a"}) + + o(vnode.tag).equals("div") + o(vnode.attrs).equals(undefined) + o(vnode.key).equals("a") + }) o("handles many attrs", function() { var vnode = m("div", {a: "b", c: "d"}) @@ -166,6 +179,11 @@ o.spec("hyperscript", function() { o(vnode.attrs.a).equals("b") o(vnode.attrs.c).equals("d") }) + o("handles className attrs property", function() { + var vnode = m("div", {className: "a"}) + + o(vnode.attrs.className).equals("a") + }) o("handles merging classes w/ class property", function() { var vnode = m(".a", {class: "b"})