diff options
author | Simon Knox <psimyn@gmail.com> | 2017-10-26 18:53:52 +0300 |
---|---|---|
committer | Simon Knox <psimyn@gmail.com> | 2017-10-27 15:13:18 +0300 |
commit | 1d298e4939c5230251d5bc3ad9a58ec34196e4b1 (patch) | |
tree | 647a9cdf5318ec372f2435856596564ee8745e17 /spec/javascripts/smart_interval_spec.js | |
parent | 9101cce2a7c30a832b3d97d84cd53ca503a163d1 (diff) |
add changelog and spec
Diffstat (limited to 'spec/javascripts/smart_interval_spec.js')
-rw-r--r-- | spec/javascripts/smart_interval_spec.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/javascripts/smart_interval_spec.js b/spec/javascripts/smart_interval_spec.js index c602eda9560..bc835198242 100644 --- a/spec/javascripts/smart_interval_spec.js +++ b/spec/javascripts/smart_interval_spec.js @@ -58,6 +58,18 @@ import '~/smart_interval'; done(); }, DEFAULT_LONG_TIMEOUT); }); + + it('does not increment while waiting for callback', function (done) { + const smartInterval = createDefaultSmartInterval({ + callback: () => new Promise($.noop), + }); + + setTimeout(() => { + const oneInterval = smartInterval.cfg.startingInterval * DEFAULT_INCREMENT_FACTOR; + expect(smartInterval.getCurrentInterval()).toEqual(oneInterval); + done(); + }, DEFAULT_SHORT_TIMEOUT); + }); }); describe('Public methods', function () { |