summaryrefslogtreecommitdiffstats
path: root/core/js/tests/specs
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-10-06 14:58:02 +0200
committerGitHub <noreply@github.com>2016-10-06 14:58:02 +0200
commit6d688e89c1457a682fcc07e595e96014ada36add (patch)
tree78aa4666975adaf49064fffe58f991484a623310 /core/js/tests/specs
parentead4cb92b6e59455a3d5a344ba5b0cb367d2a7ae (diff)
parent5ae6d6281132c11b73448db064e9f4ce4582659c (diff)
downloadnextcloud-server-6d688e89c1457a682fcc07e595e96014ada36add.tar.gz
nextcloud-server-6d688e89c1457a682fcc07e595e96014ada36add.zip
Merge pull request #1453 from nextcloud/do-not-reload-if-connection-lost
do not reload the page if the server is (temporarily) unreachable
Diffstat (limited to 'core/js/tests/specs')
-rw-r--r--core/js/tests/specs/coreSpec.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/js/tests/specs/coreSpec.js b/core/js/tests/specs/coreSpec.js
index 1ffe7b38a40..01a0e6acb6f 100644
--- a/core/js/tests/specs/coreSpec.js
+++ b/core/js/tests/specs/coreSpec.js
@@ -924,7 +924,7 @@ describe('Core base tests', function() {
var dataProvider = [
[200, false],
[400, false],
- [0, true],
+ [0, false],
[401, true],
[302, true],
[303, true],
@@ -979,5 +979,14 @@ describe('Core base tests', function() {
clock.tick(waitTimeMs);
expect(notificationStub.calledOnce).toEqual(true);
});
+ it('shows a temporary notification if the connection is lost', function() {
+ var xhr = { status: 0 };
+ spyOn(OC, '_ajaxConnectionLostHandler');
+
+ $(document).trigger(new $.Event('ajaxError'), xhr);
+ clock.tick(101);
+
+ expect(OC._ajaxConnectionLostHandler.calls.count()).toBe(1);
+ });
});
});