aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authornextcloud-command <nextcloud-command@users.noreply.github.com>2024-09-19 21:52:46 +0000
committerFerdinand Thiessen <opensource@fthiessen.de>2024-09-20 10:46:00 +0200
commitb6facb8701ecd7ddf63126e56770afd47573cc7e (patch)
tree55132b0b00c88367e6b873ccf30689b6b8e876e7 /core
parent085aab24ffd920df2f3610c9f6c2fa1e71a6d294 (diff)
downloadnextcloud-server-b6facb8701ecd7ddf63126e56770afd47573cc7e.tar.gz
nextcloud-server-b6facb8701ecd7ddf63126e56770afd47573cc7e.zip
chore(assets): Recompile assetschore/cleanup-warnings
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'core')
-rw-r--r--core/js/tests/specs/coreSpec.js51
1 files changed, 1 insertions, 50 deletions
diff --git a/core/js/tests/specs/coreSpec.js b/core/js/tests/specs/coreSpec.js
index a7f55d1cf39..a36d8320227 100644
--- a/core/js/tests/specs/coreSpec.js
+++ b/core/js/tests/specs/coreSpec.js
@@ -765,6 +765,7 @@ describe('Core base tests', function() {
OC.currentUser = 'dummy';
clock = sinon.useFakeTimers();
reloadStub = sinon.stub(OC, 'reload');
+ document.head.dataset.user = 'dummy'
notificationStub = sinon.stub(OC.Notification, 'show');
// unstub the error processing method
ajaxErrorStub = OC._processAjaxError;
@@ -778,47 +779,6 @@ describe('Core base tests', function() {
clock.restore();
});
- it('reloads current page in case of auth error', function() {
- var dataProvider = [
- [200, false],
- [400, false],
- [0, false],
- [401, true],
- [302, true],
- [303, true],
- [307, true]
- ];
-
- for (var i = 0; i < dataProvider.length; i++) {
- var xhr = { status: dataProvider[i][0] };
- var expectedCall = dataProvider[i][1];
-
- reloadStub.reset();
- OC._reloadCalled = false;
-
- $(document).trigger(new $.Event('ajaxError'), xhr);
-
- // trigger timers
- clock.tick(waitTimeMs);
-
- if (expectedCall) {
- expect(reloadStub.calledOnce).toEqual(true);
- } else {
- expect(reloadStub.notCalled).toEqual(true);
- }
- }
- });
- it('reload only called once in case of auth error', function() {
- var xhr = { status: 401 };
-
- $(document).trigger(new $.Event('ajaxError'), xhr);
- $(document).trigger(new $.Event('ajaxError'), xhr);
-
- // trigger timers
- clock.tick(waitTimeMs);
-
- expect(reloadStub.calledOnce).toEqual(true);
- });
it('does not reload the page if the user was navigating away', function() {
var xhr = { status: 0 };
OC._userIsNavigatingAway = true;
@@ -829,16 +789,7 @@ describe('Core base tests', function() {
clock.tick(waitTimeMs);
expect(reloadStub.notCalled).toEqual(true);
});
- it('displays notification', function() {
- var xhr = { status: 401 };
- notificationUpdateStub = sinon.stub(OC.Notification, 'showUpdate');
-
- $(document).trigger(new $.Event('ajaxError'), xhr);
-
- clock.tick(waitTimeMs);
- expect(notificationUpdateStub.notCalled).toEqual(false);
- });
it('shows a temporary notification if the connection is lost', function() {
var xhr = { status: 0 };
spyOn(OC, '_ajaxConnectionLostHandler');