|
|
|
|
|
|
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
describe('Core base tests', function() { |
|
|
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() { |
|
|
afterEach(function() { |
|
|
// many tests call window.initCore so need to unregister global events |
|
|
// many tests call window.initCore so need to unregister global events |
|
|
// ideally in the future we'll need a window.unloadCore() function |
|
|
// ideally in the future we'll need a window.unloadCore() function |
|
|
|
|
|
|
|
|
$(document).off('beforeunload.main'); |
|
|
$(document).off('beforeunload.main'); |
|
|
OC._userIsNavigatingAway = false; |
|
|
OC._userIsNavigatingAway = false; |
|
|
OC._reloadCalled = false; |
|
|
OC._reloadCalled = false; |
|
|
|
|
|
debounceStub.restore(); |
|
|
}); |
|
|
}); |
|
|
describe('Base values', function() { |
|
|
describe('Base values', function() { |
|
|
it('Sets webroots', function() { |
|
|
it('Sets webroots', function() { |