mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
Fix core tests by stubbing debounce
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
This commit is contained in:
parent
c9c2a6eb48
commit
419cb21fd6
1 changed files with 10 additions and 0 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue