diff options
Diffstat (limited to 'spec/javascripts/smart_interval_spec.js')
-rw-r--r-- | spec/javascripts/smart_interval_spec.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/javascripts/smart_interval_spec.js b/spec/javascripts/smart_interval_spec.js index d9b6dd1d487..b2ba0e4200d 100644 --- a/spec/javascripts/smart_interval_spec.js +++ b/spec/javascripts/smart_interval_spec.js @@ -66,6 +66,7 @@ describe('SmartInterval', function () { waitForPromises() .then(() => { const currentInterval = smartInterval.getCurrentInterval(); + expect(currentInterval).toBe(smartInterval.cfg.maxInterval); }) .then(done) @@ -82,6 +83,7 @@ describe('SmartInterval', function () { waitForPromises() .then(() => { const oneInterval = smartInterval.cfg.startingInterval * DEFAULT_INCREMENT_FACTOR; + expect(smartInterval.getCurrentInterval()).toEqual(oneInterval); }) .then(done) @@ -126,6 +128,7 @@ describe('SmartInterval', function () { waitForPromises() .then(() => { const { intervalId } = interval.state; + expect(intervalId).toBeTruthy(); }) .then(done) @@ -212,6 +215,7 @@ describe('SmartInterval', function () { waitForPromises() .then(() => { $(document).triggerHandler('beforeunload'); + expect(interval.state.intervalId).toBeUndefined(); expect(interval.getCurrentInterval()).toBe(interval.cfg.startingInterval); }) @@ -221,6 +225,7 @@ describe('SmartInterval', function () { it('should execute callback before first interval', function () { const interval = createDefaultSmartInterval({ immediateExecution: true }); + expect(interval.cfg.immediateExecution).toBeFalsy(); }); }); |