Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-07-26 16:44:57 +0300
committerVincent Petry <vincent@nextcloud.com>2022-07-26 16:47:12 +0300
commitb0be67fb743deca22195924615bb708645da6cf4 (patch)
treef2041060e3a2bc4cdb727e6c84d461aa6a08fe16 /core
parent6c81f543b2670e087597af7bbfdd1cd00e633b28 (diff)
Fix core tests by stubbing debounce
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'core')
-rw-r--r--core/js/tests/specs/coreSpec.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/js/tests/specs/coreSpec.js b/core/js/tests/specs/coreSpec.js
index 8adea2123e0..7f5a8b10d89 100644
--- a/core/js/tests/specs/coreSpec.js
+++ b/core/js/tests/specs/coreSpec.js
@@ -20,6 +20,15 @@
*/
describe('Core base tests', function() {
+ var debounceStub
+ beforeEach(function() {
+ debounceStub = sinon.stub(_, 'debounce').callsFake(function(callback) {
+ return function() {
+ // defer instead of debounce, to make it work with clock
+ _.defer(callback);
+ };
+ });
+ });
afterEach(function() {
// many tests call window.initCore so need to unregister global events
// ideally in the future we'll need a window.unloadCore() function
@@ -28,6 +37,7 @@ describe('Core base tests', function() {
$(document).off('beforeunload.main');
OC._userIsNavigatingAway = false;
OC._reloadCalled = false;
+ debounceStub.restore();
});
describe('Base values', function() {
it('Sets webroots', function() {