From 9b898c25cca663dec22e8368e5cfc87a08aff628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Gro=CC=88nke?= Date: Thu, 30 Jul 2015 19:50:04 +0200 Subject: [PATCH] remove dead debounce test assertion --- test/unit/utils.html | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/test/unit/utils.html b/test/unit/utils.html index bc14a3feed..bebd5ca94d 100644 --- a/test/unit/utils.html +++ b/test/unit/utils.html @@ -57,6 +57,44 @@ }); + suite('debounce', function() { + + test('debounce (no-wait)', function(done) { + + var called = 0; + var cb = function() { + called++; + }; + + window.el1.debounce('foo', cb); + window.el1.debounce('foo', cb); + window.el1.debounce('foo', cb); + + setTimeout(function() { + assert.equal(called, 1, 'debounce should be called exactly once'); + done(); + }, 50); + + }); + + test('debounce (wait)', function(done) { + + var called = 0; + var cb = function() { + called++; + }; + + window.el1.debounce('foo', cb); + window.el1.debounce('foo', cb, 100); + + setTimeout(function() { + assert.equal(called, 1, 'debounce should be called exactly once'); + done(); + }, 200); + + }); + + });