summaryrefslogtreecommitdiffstats
path: root/test/test.clear.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.clear.js')
-rw-r--r--test/test.clear.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test.clear.js b/test/test.clear.js
index 0e5a0f8..ee60f2e 100644
--- a/test/test.clear.js
+++ b/test/test.clear.js
@@ -76,4 +76,22 @@ suite('Clear', function(){
});
});
+ test("Should remove reference to the job if cleared", function(done) {
+ var fastdom = new FastDom();
+ var write = sinon.spy();
+ var id = fastdom.defer(2, write);
+
+ fastdom.clear(id);
+
+ raf(function() {
+ raf(function() {
+ raf(function() {
+ assert(!write.called);
+ assert(!fastdom.jobs[id]);
+ done();
+ });
+ });
+ });
+ });
+
}); \ No newline at end of file