|
|
|
@ -305,6 +305,7 @@ describe('Core base tests', function() { |
|
|
|
|
counter++; |
|
|
|
|
xhr.respond(200, {'Content-Type': 'application/json'}, '{}'); |
|
|
|
|
}); |
|
|
|
|
$(document).off('ajaxComplete'); // ignore previously registered heartbeats
|
|
|
|
|
}); |
|
|
|
|
afterEach(function() { |
|
|
|
|
clock.restore(); |
|
|
|
@ -312,6 +313,7 @@ describe('Core base tests', function() { |
|
|
|
|
window.oc_config = oldConfig; |
|
|
|
|
routeStub.restore(); |
|
|
|
|
$(document).off('ajaxError'); |
|
|
|
|
$(document).off('ajaxComplete'); |
|
|
|
|
}); |
|
|
|
|
it('sends heartbeat half the session lifetime when heartbeat enabled', function() { |
|
|
|
|
/* jshint camelcase: false */ |
|
|
|
@ -340,7 +342,7 @@ describe('Core base tests', function() { |
|
|
|
|
clock.tick(20 * 1000); |
|
|
|
|
expect(counter).toEqual(2); |
|
|
|
|
}); |
|
|
|
|
it('does no send heartbeat when heartbeat disabled', function() { |
|
|
|
|
it('does not send heartbeat when heartbeat disabled', function() { |
|
|
|
|
/* jshint camelcase: false */ |
|
|
|
|
window.oc_config = { |
|
|
|
|
session_keepalive: false, |
|
|
|
|