浏览代码

Fix core tests by stubbing debounce

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
tags/v25.0.0beta1
Vincent Petry 1年前
父节点
当前提交
3df85205b4
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10
    0
      core/js/tests/specs/coreSpec.js

+ 10
- 0
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() {

正在加载...
取消
保存