From 37e7b67a492060eed819371f0f0dac72855dba5d Mon Sep 17 00:00:00 2001 From: Pierre-Yves Gerardy Date: Sun, 24 Jul 2016 14:09:33 +0200 Subject: [PATCH] Add a test for unmounting. --- api/tests/test-mount.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/api/tests/test-mount.js b/api/tests/test-mount.js index 6baeea67..ee383c65 100644 --- a/api/tests/test-mount.js +++ b/api/tests/test-mount.js @@ -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()