Add a test for unmounting.

This commit is contained in:
Pierre-Yves Gerardy 2016-07-24 14:09:33 +02:00
parent 56fbda9670
commit 37e7b67a49

View file

@ -32,6 +32,20 @@ o.spec("mount", function() {
o(root.firstChild.nodeName).equals("DIV")
})
o("mounting null deletes `redraw` from `root`", function() {
mount(root, {
view : function() {
return m("div")
}
})
o(typeof root.redraw).equals('function')
mount(root, null)
o(typeof root.redraw).equals('undefined')
})
o("redraws on events", function(done) {
var onupdate = o.spy()
var oninit = o.spy()