Преглед на файлове

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…
Отказ
Запис