Skip to content

Commit

Permalink
migrate to 12.0.1 version
Browse files Browse the repository at this point in the history
  • Loading branch information
ksercs committed Dec 14, 2021
1 parent 3376c89 commit 48d36e6
Show file tree
Hide file tree
Showing 31 changed files with 365 additions and 574 deletions.
786 changes: 282 additions & 504 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@
"run-sequence": "^1.1.5",
"sass": "1.43.5",
"shelljs": "^0.8.3",
"sinon": "1.10.3",
"sinon": "^12.0.1",
"sinon-test": "^3.1.1",
"staged-git-files": "^1.2.0",
"string-replace-loader": "^3.0.3",
"stylelint": "^13.13.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ QUnit.test('binding should fired once when option is a plain object', function(a

const instance = $markup.dxTest('instance');

spy.reset();
spy.resetHistory();
instance.option('testOption', { value: 2 });

assert.equal(spy.callCount, 1, 'optionChanged action fired once');
Expand Down Expand Up @@ -683,7 +683,7 @@ QUnit.test('option changed fired after value was set in the same value(plain obj

instance.option('testOption', value);

spy.reset();
spy.resetHistory();
scope.$apply(() => {
scope.dataValue.value = 3;
});
Expand Down
2 changes: 1 addition & 1 deletion testing/tests/DevExpress.angular/modelIntegration.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ QUnit.test('optionChanged should fired once when value is a plain object and use

angular.bootstrap(this.$container, ['app']);

spy.reset();
spy.resetHistory();

const instance = $markup.dxEditor('instance');

Expand Down
4 changes: 2 additions & 2 deletions testing/tests/DevExpress.ui.widgets.dataGrid/focus.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -3384,7 +3384,7 @@ QUnit.module('Focused row', getModuleConfig(true), () => {
this.clock.tick();

// act
loadSpy.reset();
loadSpy.resetHistory();
this.getController('columns').changeSortOrder(2, 'asc');
this.clock.tick();

Expand Down Expand Up @@ -4096,7 +4096,7 @@ QUnit.module('Focused row', getModuleConfig(true), () => {
assert.ok(newRow.isNewRow, 'new row');

// act
onFocusedRowChangedSpy.reset();
onFocusedRowChangedSpy.resetHistory();
$(this.getRowElement(newRowIndex)).find('.dx-texteditor-input').trigger(pointerEvents.down).click();
this.clock.tick();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4193,7 +4193,7 @@ QUnit.module('Header Filter with real columnsController', {
}];
this.options.dataSource = { load: spy };
this.setupDataGrid();
spy.reset();
spy.resetHistory();

// act
this.columnOption('date', 'filterValues', [['date', '=', '2018/01/01']]);
Expand Down
10 changes: 5 additions & 5 deletions testing/tests/DevExpress.ui.widgets.editors/calendar.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2284,7 +2284,7 @@ QUnit.module('disabledDates option', {
});

fx.off = false;
animationSpy.reset();
animationSpy.resetHistory();

const lastAvailableDateOnJanuary = new Date(2020, 0, 19);
const firstAvailableDateOnFebruary = new Date(2020, 1, 20);
Expand Down Expand Up @@ -2339,7 +2339,7 @@ QUnit.module('disabledDates option', {
});

fx.off = false;
animationSpy.reset();
animationSpy.resetHistory();

this.$element.trigger('focusin');

Expand Down Expand Up @@ -2577,7 +2577,7 @@ QUnit.module('disabledDates option', {
});

fx.off = false;
animationSpy.reset();
animationSpy.resetHistory();

this.$element.trigger('focusin');

Expand Down Expand Up @@ -2703,7 +2703,7 @@ QUnit.module('disabledDates option', {
});

fx.off = false;
animationSpy.reset();
animationSpy.resetHistory();

this.$element.trigger('focusin');

Expand Down Expand Up @@ -2739,7 +2739,7 @@ QUnit.module('disabledDates option', {
});

fx.off = false;
animationSpy.reset();
animationSpy.resetHistory();

this.$element.trigger('focusin');

Expand Down
28 changes: 14 additions & 14 deletions testing/tests/DevExpress.ui.widgets.editors/fileUploader.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -745,9 +745,9 @@ QUnit.module('custom uploading', moduleConfig, () => {
assert.strictEqual(onUploadedSpy.callCount, 1, 'uploaded event raised');
assert.strictEqual(onAbortedSpy.callCount, 0, 'upload aborted event is not called');

uploadChunkSpy.reset();
onUploadedSpy.reset();
onAbortedSpy.reset();
uploadChunkSpy.resetHistory();
onUploadedSpy.resetHistory();
onAbortedSpy.resetHistory();

fileUploader.option('value', []);

Expand Down Expand Up @@ -1606,8 +1606,8 @@ QUnit.module('allowCanceling', moduleConfig, () => {
assert.ok(onUploadAbortedSpy.calledOnce, 'upload is cancelled');
assert.ok(onUploadedSpy.notCalled, 'upload is not finished');

onUploadAbortedSpy.reset();
onUploadedSpy.reset();
onUploadAbortedSpy.resetHistory();
onUploadedSpy.resetHistory();

let $fileStatusMessage = $element.find('.' + FILEUPLOADER_FILE_STATUS_MESSAGE_CLASS);
let $progressBar = $element.find('.dx-progressbar');
Expand Down Expand Up @@ -2979,7 +2979,7 @@ QUnit.module('uploading events', moduleConfig, () => {
assert.ok(onUploadedSpy.calledOnce, 'file 1 uploaded');
assert.ok(onUploadCompletedSpy.notCalled, 'onUploadCompletedSpy was not called');

onUploadedSpy.reset();
onUploadedSpy.resetHistory();
this.clock.tick(this.xhrMock.LOAD_TIMEOUT);
this.clock.tick(FILEUPLOADER_AFTER_LOAD_DELAY);

Expand Down Expand Up @@ -3013,7 +3013,7 @@ QUnit.module('uploading events', moduleConfig, () => {
assert.ok(onUploadAbortedSpy.notCalled, 'none files was aborted');
assert.ok(onUploadCompletedSpy.notCalled, 'onUploadCompletedSpy was not called');

onUploadedSpy.reset();
onUploadedSpy.resetHistory();
$element.dxFileUploader('instance').abortUpload();
this.clock.tick(this.xhrMock.LOAD_TIMEOUT * 2);
this.clock.tick(FILEUPLOADER_AFTER_LOAD_DELAY);
Expand Down Expand Up @@ -3055,7 +3055,7 @@ QUnit.module('uploading events', moduleConfig, () => {
assert.ok(onUploadErrorSpy.notCalled, 'none files has error');
assert.ok(onUploadCompletedSpy.notCalled, 'onUploadCompletedSpy was not called');

onUploadedSpy.reset();
onUploadedSpy.resetHistory();
this.clock.tick(1000);
this.clock.tick(this.xhrMock.LOAD_TIMEOUT);
this.clock.tick(FILEUPLOADER_AFTER_LOAD_DELAY);
Expand Down Expand Up @@ -3092,8 +3092,8 @@ QUnit.module('uploading events', moduleConfig, () => {
assert.ok(onUploadedSpy.calledOnce, 'file 1 was uploaded');
assert.ok(onUploadCompletedSpy.calledOnce, 'onUploadCompletedSpy was called in right time');

onUploadedSpy.reset();
onUploadCompletedSpy.reset();
onUploadedSpy.resetHistory();
onUploadCompletedSpy.resetHistory();
this.clock.tick(1000);
this.clock.tick(this.xhrMock.LOAD_TIMEOUT);
this.clock.tick(FILEUPLOADER_AFTER_LOAD_DELAY);
Expand Down Expand Up @@ -3139,7 +3139,7 @@ QUnit.module('uploading events', moduleConfig, () => {
assert.ok(onUploadErrorSpy.notCalled, 'none files has error');
assert.ok(onUploadCompletedSpy.notCalled, 'onUploadCompletedSpy was not called');

onUploadedSpy.reset();
onUploadedSpy.resetHistory();
this.clock.tick(1000);
this.clock.tick(this.xhrMock.LOAD_TIMEOUT);
this.clock.tick(FILEUPLOADER_AFTER_LOAD_DELAY);
Expand Down Expand Up @@ -3591,8 +3591,8 @@ QUnit.module('Drag and drop', moduleConfig, () => {
assert.ok(onDropZoneLeaveSpy.calledOnce, 'dropZoneLeave called on first dropZone');
assert.strictEqual(onDropZoneLeaveSpy.args[0][0].dropZoneElement, customDropZone1[0], 'dropZone argument is correct');

onDropZoneEnterSpy.reset();
onDropZoneLeaveSpy.reset();
onDropZoneEnterSpy.resetHistory();
onDropZoneLeaveSpy.resetHistory();

triggerDragEvent(customDropZone2, 'dragenter');
assert.ok(onDropZoneEnterSpy.calledOnce, 'dropZoneEnter called on second dropZone');
Expand Down Expand Up @@ -3749,7 +3749,7 @@ QUnit.module('files selection', moduleConfig, () => {
this.clock.tick(this.xhrMock.LOAD_TIMEOUT * 2);
assert.ok(uploadedSpy.calledTwice, 'two files are loaded');

uploadedSpy.reset();
uploadedSpy.resetHistory();
simulateFileChoose($fileUploader, files);
instance.upload();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4966,7 +4966,7 @@ QUnit.module('the \'fieldTemplate\' option', moduleSetup, () => {
focusStateEnabled: true
});

fieldTemplateSpy.reset();
fieldTemplateSpy.resetHistory();
keyboardMock($tagBox.find('.dx-texteditor-input'))
.focus()
.press('down');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ QUnit.module('Update on validator\'s validation', {
ValidationEngine.validateGroup('group1');
ValidationEngine.validateGroup('group1');

spy.reset();
spy.resetHistory();
validator1.validate();

assert.equal(spy.callCount, 1, 'Render of validation summary should be called only once');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import $ from 'jquery';
import SinonTest from 'sinon-test';
import fx from 'animation/fx';
import { DataSource } from 'data/data_source/data_source';
import {
Expand All @@ -11,12 +12,14 @@ import {
import 'ui/scheduler/ui.scheduler';
import 'ui/switch';

const sinonTest = SinonTest(sinon);
const {
module
} = QUnit;


const test = (description, callback) => {
return QUnit.test(description, sinon.test(callback));
return QUnit.test(description, sinonTest(callback));
};

QUnit.testStart(() => initTestMarkup());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ QUnit.module('Appointments Keyboard Navigation', moduleOptions, () => {

this.clock.tick();
assert.ok(focusSpy.called, 'focus is called');
sinon.restore();
focusSpy.restore();

eventsEngine.trigger = initialTrigger;
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import $ from 'jquery';
import SinonTest from 'sinon-test';

import { getWindow } from 'core/utils/window';

Expand All @@ -15,6 +16,7 @@ import {

const supportedViews = ['day', 'week', 'workWeek', 'month']; // TODO: add timelines

const sinonTest = SinonTest(sinon);
const {
testStart,
module
Expand All @@ -24,7 +26,7 @@ const test = (description, callback) => {
const testFunc = !isDesktopEnvironment()
? QUnit.skip
: QUnit.test;
return testFunc(description, sinon.test(callback));
return testFunc(description, sinonTest(callback));
};

testStart(() => initTestMarkup());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'generic_light.css!';
import $ from 'jquery';
import SinonTest from 'sinon-test';

import dateUtils from 'core/utils/date';
import {
Expand All @@ -10,6 +11,7 @@ import {
isDesktopEnvironment,
} from '../../helpers/scheduler/helpers.js';

const sinonTest = SinonTest(sinon);
const {
testStart,
module
Expand All @@ -20,7 +22,7 @@ const test = (description, callback) => {
? QUnit.skip
: QUnit.test;

return testFunc(description, sinon.test(callback));
return testFunc(description, sinonTest(callback));
};
const printOffset = offset => [
offset.x >= 0 ? `offset.x: ${offset.x}` : '',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import $ from 'jquery';
import SinonTest from 'sinon-test';
import { VirtualScrollingDispatcher } from 'ui/scheduler/workspaces/ui.scheduler.virtual_scrolling';
import domAdapter from 'core/dom_adapter';
import eventsEngine from 'events/core/events_engine';
Expand All @@ -7,9 +8,10 @@ import { addNamespace } from 'events/utils/index';
const {
module
} = QUnit;
const sinonTest = SinonTest(sinon);

const test = (description, callback) => {
return QUnit.test(description, sinon.test(callback));
return QUnit.test(description, sinonTest(callback));
};

module('Virtual Scrolling', {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import SinonTest from 'sinon-test';

import 'generic_light.css!';

import {
Expand All @@ -12,13 +14,14 @@ const {
testStart,
module
} = QUnit;
const sinonTest = SinonTest(sinon);

const test = (description, callback) => {
const testFunc = !isDesktopEnvironment()
? QUnit.skip
: QUnit.test;

return testFunc(description, sinon.test(callback));
return testFunc(description, sinonTest(callback));
};
const printOffset = offset => [
offset.x >= 0 ? `offset.x: ${offset.x}` : '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ QUnit.module('Expand/Collapse nodes', { beforeEach: setupModule, afterEach: tear
}
});
clock.tick(30);
loadSpy.reset();
loadSpy.resetHistory();

// act
this.expandRow(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1940,7 +1940,7 @@ QUnit.module('Scroll', defaultModuleConfig, () => {
assert.equal($(treeList.getCellElement(0, 0)).text(), '0', 'first row first cell');
assert.equal($(treeList.getCellElement(1, 0)).text(), '1', 'second row first cell');

loadSpy.reset();
loadSpy.resetHistory();
});

// T991320
Expand Down
4 changes: 2 additions & 2 deletions testing/tests/DevExpress.ui.widgets/draggable.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ QUnit.module('Events', moduleConfig, () => {
}, $('#items'));

const pointer = this.pointer.down().move(0, 50);
onDragEnterSpy.reset();
onDragEnterSpy.resetHistory();

// act
pointer.move(0, 250).move(0, 50);
Expand All @@ -735,7 +735,7 @@ QUnit.module('Events', moduleConfig, () => {
}, $('#items'));

const pointer = this.pointer.down().move(0, 300).move(0, 50);
onDragLeaveSpy.reset();
onDragLeaveSpy.resetHistory();

// act
pointer.move(0, -200);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ QUnit.module('Raise context menu', moduleConfig, () => {
this.clock.tick(800);

this.wrapper.getContextMenuItems().eq(0).trigger('dxclick');
spy.reset();
spy.resetHistory();
this.clock.tick(800);

const $subItems = this.wrapper.getContextMenuSubMenuItems();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ QUnit.module('live update', {
const $moreButton = $('#templated-list .dx-list-next-button > .dx-button').eq(0);
$moreButton.trigger('dxclick');

this.itemRenderedSpy.reset();
this.itemRenderedSpy.resetHistory();
const pushData = [
{ type: 'update', data: { a: 'Item 0 Updated', id: 0 }, key: 0 },
{ type: 'update', data: { a: 'Item 2 Updated', id: 2 }, key: 2 },
Expand Down
2 changes: 1 addition & 1 deletion testing/tests/DevExpress.viz.core/baseAxis.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2154,7 +2154,7 @@ QUnit.test('T746896. Pass correct range to tick generator after syncroniztion',
max: 250
});

this.tickGeneratorSpy.reset();
this.tickGeneratorSpy.resetHistory();

axis.createTicks(this.canvas);

Expand Down
Loading

0 comments on commit 48d36e6

Please sign in to comment.