Skip to content

Commit

Permalink
remove dead debounce test assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
gronke authored and dfreedm committed Dec 9, 2015
1 parent d468949 commit 9b898c2
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions test/unit/utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -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);

});

});

</script>
</body>
Expand Down

0 comments on commit 9b898c2

Please sign in to comment.