Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
6a0f5cfc
Commit
6a0f5cfc
authored
10 years ago
by
Vincent Petry
Browse files
Options
Downloads
Patches
Plain Diff
Added unit tests for heartbeat interval min/max values
parent
ce168c28
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/js/tests/specs/coreSpec.js
+23
-1
23 additions, 1 deletion
core/js/tests/specs/coreSpec.js
with
23 additions
and
1 deletion
core/js/tests/specs/coreSpec.js
+
23
−
1
View file @
6a0f5cfc
...
...
@@ -19,7 +19,6 @@
*
*/
/* global OC */
describe
(
'
Core base tests
'
,
function
()
{
describe
(
'
Base values
'
,
function
()
{
it
(
'
Sets webroots
'
,
function
()
{
...
...
@@ -235,10 +234,12 @@ describe('Core base tests', function() {
});
afterEach
(
function
()
{
clock
.
restore
();
/* jshint camelcase: false */
window
.
oc_config
=
oldConfig
;
routeStub
.
restore
();
});
it
(
'
sends heartbeat half the session lifetime when heartbeat enabled
'
,
function
()
{
/* jshint camelcase: false */
window
.
oc_config
=
{
session_keepalive
:
true
,
session_lifetime
:
300
...
...
@@ -265,6 +266,7 @@ describe('Core base tests', function() {
expect
(
counter
).
toEqual
(
2
);
});
it
(
'
does no send heartbeat when heartbeat disabled
'
,
function
()
{
/* jshint camelcase: false */
window
.
oc_config
=
{
session_keepalive
:
false
,
session_lifetime
:
300
...
...
@@ -279,6 +281,26 @@ describe('Core base tests', function() {
// still nothing
expect
(
counter
).
toEqual
(
0
);
});
it
(
'
limits the heartbeat between one minute and one day
'
,
function
()
{
/* jshint camelcase: false */
var
setIntervalStub
=
sinon
.
stub
(
window
,
'
setInterval
'
);
window
.
oc_config
=
{
session_keepalive
:
true
,
session_lifetime
:
5
};
window
.
initCore
();
expect
(
setIntervalStub
.
getCall
(
0
).
args
[
1
]).
toEqual
(
60
*
1000
);
setIntervalStub
.
reset
();
window
.
oc_config
=
{
session_keepalive
:
true
,
session_lifetime
:
48
*
3600
};
window
.
initCore
();
expect
(
setIntervalStub
.
getCall
(
0
).
args
[
1
]).
toEqual
(
24
*
3600
*
1000
);
setIntervalStub
.
restore
();
});
});
describe
(
'
Parse query string
'
,
function
()
{
it
(
'
Parses query string from full URL
'
,
function
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment