소스 검색

Fix core tests by stubbing debounce

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
tags/v25.0.0beta1
Vincent Petry 1 년 전
부모
커밋
3df85205b4
No account linked to committer's email address
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() {

Loading…
취소
저장