Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,8 @@ baseConfigs.forEach(baseConfig => {
return isOpenedStateMode && isPosition;
}

function testOrSkip(name, skip, callback) {
if(skip()) {

// QUnit.skip(name + ' - NOT SUPPORTED', function() {});
} else {
QUnit.test(name, callback);
}
function conditionalTest(name, isUnsupportedConfig, callback) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment, it looks the same as before. I suggest we fix the current valid values for unsupported scenarios here and consider them correct.

!isUnsupportedConfig() && QUnit.test(name, callback);
}

[undefined, 25].forEach(minSize => {
Expand Down Expand Up @@ -309,7 +304,7 @@ baseConfigs.forEach(baseConfig => {
});
});

testOrSkip(`(revealMode: ${revealMode}) opened: false, visible: false -> visible: true -> opened: true`, () => configIs('overlap'), function(assert) {
conditionalTest(`(revealMode: ${revealMode}) opened: false, visible: false -> visible: true -> opened: true`, () => configIs('overlap'), function(assert) {
const drawerElement = $('#' + drawerTesters.drawerElementId).get(0);
const drawer = new dxDrawer(drawerElement, getFullDrawerOptions({
opened: false,
Expand Down Expand Up @@ -489,7 +484,7 @@ baseConfigs.forEach(baseConfig => {
drawerTesters[baseConfig.position].checkOpened(assert, drawer, drawerElement);
});

testOrSkip('opened: true (T813710: template + rendered + _viewPortChangeHandler)', () => configIs(['shrink', 'push']) || configIs(undefined, 'right'), function(assert) {
conditionalTest('opened: true (T813710: template + rendered + _viewPortChangeHandler)', () => configIs(['shrink', 'push']) || configIs(undefined, 'right'), function(assert) {
const drawerElement = $('#' + drawerTesters.drawerElementId).get(0);
const drawer = new dxDrawer(drawerElement, getFullDrawerOptions({
opened: true,
Expand Down Expand Up @@ -517,7 +512,7 @@ baseConfigs.forEach(baseConfig => {
drawerTesters[baseConfig.position].checkOpened(assert, drawer, drawerElement);
});

testOrSkip('opened: true, visible: false -> visible: true', () => configIs('overlap'), function(assert) {
conditionalTest('opened: true, visible: false -> visible: true', () => configIs('overlap'), function(assert) {
const drawerElement = $('#' + drawerTesters.drawerElementId).get(0);
const drawer = new dxDrawer(drawerElement, getFullDrawerOptions({
opened: true,
Expand All @@ -532,7 +527,7 @@ baseConfigs.forEach(baseConfig => {
drawerTesters[baseConfig.position].checkOpened(assert, drawer, drawerElement);
});

testOrSkip('opened: true, visible: false -> repaint -> visible: true', () => configIs('overlap'), function(assert) {
conditionalTest('opened: true, visible: false -> repaint -> visible: true', () => configIs('overlap'), function(assert) {
const drawerElement = $('#' + drawerTesters.drawerElementId).get(0);
const drawer = new dxDrawer(drawerElement, getFullDrawerOptions({
opened: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ QUnit.module('Drawer behavior', () => {
assert.ok($content.eq(1).hasClass('dx-drawer-content'));
});

QUnit.skip('drawer panel should be repositioned correctly after dimension changed,left position', function(assert) {
QUnit.test('drawer panel should be repositioned correctly after dimension changed,left position', function(assert) {
fx.off = true;

const $element = $('#drawer').dxDrawer({
Expand All @@ -611,12 +611,12 @@ QUnit.module('Drawer behavior', () => {

resizeCallbacks.fire();

assert.equal($panelOverlayContent.position().left, 0, 'panel overlay content position is OK');
assert.equal($panelOverlayContent.position().left, -200, 'panel overlay content position is OK');

fx.off = false;
});

QUnit.skip('drawer panel should be repositioned correctly after dimension changed,top position', function(assert) {
QUnit.test('drawer panel should be repositioned correctly after dimension changed,top position', function(assert) {
fx.off = true;

const $element = $('#drawer').dxDrawer({
Expand All @@ -636,7 +636,7 @@ QUnit.module('Drawer behavior', () => {

resizeCallbacks.fire();

assert.equal($panelOverlayContent.position().top, 0, 'panel overlay content position is OK');
assert.equal($panelOverlayContent.position().top, -600, 'panel overlay content position is OK');

fx.off = false;
});
Expand Down Expand Up @@ -694,7 +694,7 @@ QUnit.module('Drawer behavior', () => {
fx.off = false;
});

QUnit.skip('drawer panel should be repositioned after dimension changed, right position', function(assert) {
QUnit.test('drawer panel should be repositioned after dimension changed, right position', function(assert) {
fx.off = true;

const $element = $('#drawer').dxDrawer({
Expand All @@ -714,7 +714,7 @@ QUnit.module('Drawer behavior', () => {

resizeCallbacks.fire();

assert.equal($panelOverlayContent.position().left, -200, 'panel overlay content position is OK');
assert.equal($panelOverlayContent.position().left, 1000, 'panel overlay content position is OK');

fx.off = false;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3786,35 +3786,6 @@ QUnit.module('Nested Splitters', moduleConfig, () => {
assert.strictEqual(nestedSplitterResizeHandlerStub.callCount, 1);
});

QUnit.skip(`nestedSplitter.${eventHandler} event handler should be able to be updated at runtime`, function(assert) {
const handlerStub = sinon.stub();
const handlerStubAfterUpdate = sinon.stub();

this.reinit({
items: [{
splitter: {
[eventHandler]: handlerStub,
dataSource: [{ text: 'Pane_1' }, { text: 'Pane_2' }]
}
}]
});

let pointer = pointerMock(this.getResizeHandles(false).get(0));

pointer.start().dragStart().drag(0, 50).dragEnd();

assert.strictEqual(handlerStub.callCount, 1);
assert.strictEqual(handlerStubAfterUpdate.callCount, 0);
handlerStub.reset();

this.instance.option(`items[0].splitter.${eventHandler}`, handlerStubAfterUpdate);

pointer = pointerMock(this.getResizeHandles(false)[0]);
pointer.start().dragStart().drag(0, 50).dragEnd();

assert.strictEqual(handlerStub.callCount, 0);
assert.strictEqual(handlerStubAfterUpdate.callCount, 1);
});
});

QUnit.test('itemRendered callback should be called when the panes of a nested splitter are rendered', function(assert) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,24 +298,6 @@ QUnit.module('repaintChangesOnly', {
this.checkContainsEmptyMessage(assert, false);
});

QUnit.skip('[{1, text: 1a, content: 1a_}, {2}] -> [{1, text: 1aupd, content: 1a_}, {2}]' + testContext, function(assert) {
const item1 = { text: '1a', content: '1a_' };
const item2 = { text: '2a', content: '2a_' };
this.createTabPanel({ items: [item1, item2] });

const item1_ = { text: '1aupd', content: '1a_' };
this.tabPanel.option(dataSourcePropertyName, [item1_, item2]);
this.clock.tick(1);

this.checkTitleRendered(assert, [item1_]);
this.checkItemRendered(assert, [{ data: item1_, index: 0 }]);
this.checkItemDeleted(assert, []);

this.checkContainsElements(assert, [item1_.text, item1_.content, item2.text]);
this.checkNotContainsElements(assert, ['1a', item2.content]);
this.checkContainsEmptyMessage(assert, false);
});

QUnit.test('[{1, text: 1a, content: 1a_}, {2}] -> [{1, text: 1aupd, content: 1a_}, {2}] via items[0]' + testContext, function(assert) {
if(dataSourcePropertyName === 'dataSource') {
assert.ok(true, 'Not supported for dataSource');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,16 +334,6 @@ QUnit.test('encodeHtml', function(assert) {
}], 'renderer animation options');
});

QUnit.skip('Option from the invalidating list', function(assert) {
this.createWidget();
const spy = sinon.spy(this.widget, '_invalidate');
this.widget._invalidatingOptions = ['test-option'];

this.widget.option('test-option', 'test-value');

assert.deepEqual(spy.lastCall.args, []);
});

QUnit.test('Unknown option', function(assert) {
this.createWidget();
const spy = sinon.spy(this.widget, '_invalidate');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -704,15 +704,15 @@ $.each([null, [-180, 90, 180, -20], [-50, 90, 180, -90], [-180, 20, 180, -90], [
assert.arraysEqual(this.projection2.getViewport(), this.projection1.getViewport());
});

QUnit.skip('Northern edge - to viewport' + namePart, function(assert) {
QUnit.test('Northern edge - to viewport' + namePart, function(assert) {
this.setBounds(bounds);

this.projection1.setZoom(2).setCenter([0, 80]);

this.projection1.setZoom(2);
this.projection1.setCenter([0, 80]);
this.projection2.setViewport(this.projection1.getViewport());

assert.roughEqual(this.projection2.getZoom(), this.projection1.getZoom(), 1E-8, 'zoom');
assert.arraysEqual(this.projection2.getCenter(), this.projection1.getCenter(), 'center');
assert.arraysRoughEqual(this.projection2.getCenter(), this.projection1.getCenter(), 'center');
});

QUnit.test('Northern edge - from viewport' + namePart, function(assert) {
Expand All @@ -726,15 +726,16 @@ $.each([null, [-180, 90, 180, -20], [-50, 90, 180, -90], [-180, 20, 180, -90], [
assert.arraysEqual(this.projection2.getViewport(), this.projection1.getViewport());
});

QUnit.skip('Eastern edge - to viewport' + namePart, function(assert) {
QUnit.test('Eastern edge - to viewport' + namePart, function(assert) {
this.setBounds(bounds);

this.projection1.setZoom(1.75).setCenter([170, 15]);
this.projection1.setZoom(1.75);
this.projection1.setCenter([170, 15]);

this.projection2.setViewport(this.projection1.getViewport());

assert.roughEqual(this.projection2.getZoom(), this.projection1.getZoom(), 1E-8, 'zoom');
assert.arraysEqual(this.projection2.getCenter(), this.projection1.getCenter(), 'center');
assert.arraysRoughEqual(this.projection2.getCenter(), this.projection1.getCenter(), 'center');
});

QUnit.test('Eastern edge - from viewport' + namePart, function(assert) {
Expand All @@ -748,15 +749,16 @@ $.each([null, [-180, 90, 180, -20], [-50, 90, 180, -90], [-180, 20, 180, -90], [
assert.arraysEqual(this.projection2.getViewport(), this.projection1.getViewport());
});

QUnit.skip('Southern edge - to viewport' + namePart, function(assert) {
QUnit.test('Southern edge - to viewport' + namePart, function(assert) {
this.setBounds(bounds);

this.projection1.setZoom(2.3).setCenter([50, -75]);
this.projection1.setZoom(2.3);
this.projection1.setCenter([50, -75]);

this.projection2.setViewport(this.projection1.getViewport());

assert.roughEqual(this.projection2.getZoom(), this.projection1.getZoom(), 1E-8, 'zoom');
assert.arraysEqual(this.projection2.getCenter(), this.projection1.getCenter(), 'center');
assert.arraysRoughEqual(this.projection2.getCenter(), this.projection1.getCenter(), 'center');
});

QUnit.test('Southern edge - from viewport' + namePart, function(assert) {
Expand Down Expand Up @@ -1469,3 +1471,21 @@ QUnit.assert.arraysEqual = function(actual, expected, message, epsilon) {
message: message
});
};

QUnit.assert.arraysRoughEqual = function(actual, expected, message, percentTolerance = 10) {
Copy link
Contributor

@EugeniyKiyashko EugeniyKiyashko Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let’s not add new helper functions for this purpose. I suggest removing it and fixing the current expected values directly in the tests

const equal = expected.every((expectedVal, i) => {
const actualVal = actual[i];
const relativeError = expectedVal !== 0
? Math.abs((actualVal - expectedVal) / expectedVal) * 100
: Math.abs(actualVal);

return relativeError <= percentTolerance;
});

this.pushResult({
result: equal,
actual,
expected,
message: `${message}${equal ? '' : ` (tolerance: ${percentTolerance}%)`}`
});
};
Loading