Skip to content

Commit 4991a47

Browse files
authored
QUnit tests: remove testing on emulated devices (ios10, android 6) (#31445)
Signed-off-by: Andrei Kharitonov <[email protected]>
1 parent 0f1fc73 commit 4991a47

File tree

54 files changed

+1
-1547
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1
-1547
lines changed

packages/devextreme/testing/helpers/device.js

Lines changed: 0 additions & 34 deletions
This file was deleted.

packages/devextreme/testing/tests/DevExpress.animation/position.tests.js

Lines changed: 0 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ import positionUtils from 'common/core/animation/position';
33
import translator from 'common/core/animation/translator';
44
import browser from 'core/utils/browser';
55
import fixtures from '../../helpers/positionFixtures.js';
6-
import devices from 'core/devices.js';
76
import { implementationsMap } from 'core/utils/size';
87
import { getWindow } from 'core/utils/window.js';
9-
import { shouldSkipOnDevices, shouldSkipOnPhone } from '../../helpers/device.js';
108

119
const setupPosition = positionUtils.setup;
1210
const calculatePosition = positionUtils.calculate;
@@ -965,10 +963,6 @@ const testCollision = (name, fixtureName, params, expectedHorzDist, expectedVert
965963
});
966964

967965
QUnit.test('position should return window.height() if window.outerHeight == window.innerHeight (T939748)', function(assert) {
968-
if(shouldSkipOnPhone(assert)) {
969-
return;
970-
}
971-
972966
if(browser.safari) {
973967
assert.ok(true, 'actual only for desktop browsers except Safari');
974968
return;
@@ -997,10 +991,6 @@ const testCollision = (name, fixtureName, params, expectedHorzDist, expectedVert
997991
});
998992

999993
QUnit.test('position should return window.width() if window.outerWidth == window.innerWidth (T939748)', function(assert) {
1000-
if(shouldSkipOnPhone(assert)) {
1001-
return;
1002-
}
1003-
1004994
if(browser.safari) {
1005995
assert.ok(true, 'actual only for desktop browsers except Safari');
1006996
return;
@@ -1028,96 +1018,6 @@ const testCollision = (name, fixtureName, params, expectedHorzDist, expectedVert
10281018
}
10291019
});
10301020

1031-
QUnit.test('position should be correct relative to the viewport on mobile devices', function(assert) {
1032-
if(shouldSkipOnDevices({ deviceTypes: ['desktop', 'tablet'], assert })) {
1033-
return;
1034-
}
1035-
1036-
const $what = $('#what').height(300).width(300);
1037-
const initialVisualViewport = window.visualViewport;
1038-
1039-
try {
1040-
window.visualViewport = {
1041-
height: 800,
1042-
width: 800,
1043-
offsetTop: 0,
1044-
offsetLeft: 0
1045-
};
1046-
1047-
const resultPosition = setupPosition($what, {
1048-
of: $(window)
1049-
});
1050-
1051-
assert.roughEqual(resultPosition.v.location, 250, 50, 'vertical location is correct');
1052-
assert.roughEqual(resultPosition.h.location, 250, 50, 'vertical location is correct');
1053-
} finally {
1054-
window.visualViewport = initialVisualViewport;
1055-
}
1056-
});
1057-
1058-
QUnit.test('position should be correct relative to the viewport on mobile devices when window is scrolled', function(assert) {
1059-
if(shouldSkipOnDevices({ deviceTypes: ['desktop', 'tablet'], assert })) {
1060-
return;
1061-
}
1062-
1063-
const $what = $('#what').height(300).width(300);
1064-
const initialVisualViewport = window.visualViewport;
1065-
1066-
try {
1067-
window.visualViewport = {
1068-
height: 800,
1069-
width: 800,
1070-
offsetTop: 300,
1071-
offsetLeft: 200
1072-
};
1073-
1074-
const resultPosition = setupPosition($what, {
1075-
of: $(window)
1076-
});
1077-
1078-
assert.roughEqual(resultPosition.v.location, 550, 50, 'vertical location is correct');
1079-
assert.roughEqual(resultPosition.h.location, 450, 50, 'horizontal location is correct');
1080-
} finally {
1081-
window.visualViewport = initialVisualViewport;
1082-
}
1083-
});
1084-
1085-
QUnit.test('position should be correct relative to the viewport on mobile devices when window is scrolled and window.scrollTop is bigger than visualViewport.offsetTop (T750017)', function(assert) {
1086-
if(shouldSkipOnDevices({ deviceTypes: ['desktop', 'tablet'], assert })) {
1087-
return;
1088-
}
1089-
1090-
const isAndroid = devices.real().platform === 'android';
1091-
if(isAndroid) {
1092-
// NOTE: scrollTop/Left are always 0 on android devices
1093-
assert.ok(true, 'only for non-android mobiles');
1094-
return;
1095-
}
1096-
1097-
const $what = $('#what').height(300).width(300);
1098-
const initialVisualViewport = window.visualViewport;
1099-
1100-
try {
1101-
window.scrollBy(500, 500);
1102-
window.visualViewport = {
1103-
height: 800,
1104-
width: 800,
1105-
offsetTop: 300,
1106-
offsetLeft: 200
1107-
};
1108-
1109-
const resultPosition = setupPosition($what, {
1110-
of: $(window)
1111-
});
1112-
1113-
assert.roughEqual(resultPosition.v.location, 750, 50, 'vertical location is correct');
1114-
assert.roughEqual(resultPosition.h.location, 750, 50, 'horizontal location is correct');
1115-
} finally {
1116-
window.visualViewport = initialVisualViewport;
1117-
window.scroll(0, 0);
1118-
}
1119-
});
1120-
11211021
// T664522
11221022
QUnit.test('setup should call resetPosition with finishTransition argument', function(assert) {
11231023
const origResetPosition = translator.resetPosition;

packages/devextreme/testing/tests/DevExpress.ui.widgets.dataGrid/columnsResizingReorderingModule.tests.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import { HeaderPanel } from '__internal/grids/data_grid/module_not_extended/head
3232
import Action from '__internal/core/m_action';
3333
import { getHeight } from 'core/utils/size';
3434
import publicComponentUtils from 'core/utils/public_component';
35-
import { shouldSkipOnMobile } from '../../helpers/device.js';
3635

3736
class TestDraggingHeader2 extends columnsResizingReordering.DraggingHeaderView {
3837
callDragCounter = 0;
@@ -2503,10 +2502,6 @@ QUnit.module('Columns resizing', {
25032502
});
25042503

25052504
QUnit.test('The free space row is not displayed when horizontal scrollbar is shown_B253714', function(assert) {
2506-
if(shouldSkipOnMobile(assert, 'height of scrollbar equals zero on mobile devices')) {
2507-
return;
2508-
}
2509-
25102505
// arrange
25112506
this.component._controllers.columns = new MockColumnsController([
25122507
{ caption: 'Column 1', visible: true, width: '150px' },

packages/devextreme/testing/tests/DevExpress.ui.widgets.dataGrid/dataGrid.tests.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { checkDxFontIcon, DX_ICON_XLSX_FILE_CONTENT_CODE, DX_ICON_EXPORT_SELECTE
2222
import { createDataGrid, baseModuleConfig, findShadowHostOrDocument } from '../../helpers/dataGridHelper.js';
2323
import { getOuterWidth } from 'core/utils/size';
2424
import { generateItems } from '../../helpers/dataGridMocks.js';
25-
import { shouldSkipOnMobile } from '../../helpers/device.js';
2625

2726
const DX_STATE_HOVER_CLASS = 'dx-state-hover';
2827
const CELL_UPDATED_CLASS = 'dx-datagrid-cell-updated-animation';
@@ -532,10 +531,6 @@ QUnit.module('Initialization', baseModuleConfig, () => {
532531
});
533532

534533
QUnit.test('Enable rows hover', function(assert) {
535-
if(shouldSkipOnMobile(assert, 'hover is disabled for non desktop devices')) {
536-
return;
537-
}
538-
539534
// arrange
540535
const $dataGrid = $('#dataGrid').dxDataGrid({
541536
dataSource: [],
@@ -557,10 +552,6 @@ QUnit.module('Initialization', baseModuleConfig, () => {
557552
});
558553

559554
QUnit.test('Enable rows hover and row position', function(assert) {
560-
if(shouldSkipOnMobile(assert, 'hover is disabled for non desktop devices')) {
561-
return;
562-
}
563-
564555
// arrange
565556
const $dataGrid = $('#dataGrid').dxDataGrid({
566557
dataSource: [],
@@ -613,10 +604,6 @@ QUnit.module('Initialization', baseModuleConfig, () => {
613604
});
614605

615606
QUnit.test('Enable rows hover via option method', function(assert) {
616-
if(shouldSkipOnMobile(assert, 'hover is disabled for non desktop devices')) {
617-
return;
618-
}
619-
620607
// arrange
621608
const $dataGrid = $('#dataGrid').dxDataGrid({
622609
dataSource: [],

packages/devextreme/testing/tests/DevExpress.ui.widgets.dataGrid/editing.integration.tests.js

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import { generateItems } from '../../helpers/dataGridMocks.js';
2020
import { getOuterHeight } from 'core/utils/size';
2121
import { getEmulatorStyles } from '../../helpers/stylesHelper.js';
2222
import messageLocalization from 'common/core/localization/message';
23-
import { shouldSkipOnDesktop, shouldSkipOnMobile } from '../../helpers/device.js';
2423

2524
const TEXTEDITOR_INPUT_SELECTOR = '.dx-texteditor-input';
2625

@@ -3321,57 +3320,6 @@ QUnit.module('Editing', baseModuleConfig, () => {
33213320
});
33223321
});
33233322

3324-
['Batch', 'Cell'].forEach((editMode) => {
3325-
QUnit.testInActiveWindow(`${editMode} - Cell value should not be reset when a checkbox in a neigboring cell is clicked (T1023809)`, function(assert) {
3326-
if(shouldSkipOnDesktop(assert)) {
3327-
return;
3328-
}
3329-
3330-
const data = [
3331-
{ id: 1, field1: 'test', field2: true }
3332-
];
3333-
const dataGrid = createDataGrid({
3334-
dataSource: data,
3335-
keyExpr: 'id',
3336-
columns: ['field1', 'field2'],
3337-
editing: {
3338-
mode: editMode.toLowerCase(),
3339-
allowUpdating: true
3340-
}
3341-
});
3342-
this.clock.tick(10);
3343-
dataGrid.editCell(0, 0);
3344-
this.clock.tick(10);
3345-
3346-
// act
3347-
const $firstCell = $(dataGrid.getCellElement(0, 0));
3348-
const $firstInput = $firstCell.find('input.dx-texteditor-input');
3349-
$firstInput.focus();
3350-
this.clock.tick(10);
3351-
3352-
// assert
3353-
assert.ok($firstCell.hasClass('dx-focused'));
3354-
assert.ok($firstInput.is(':focus'), 'input is focused');
3355-
3356-
// act
3357-
// mock for real blur
3358-
$firstInput.on('blur', function(e) {
3359-
$(e.target).trigger('change');
3360-
});
3361-
$firstInput.val('123');
3362-
let $secondCell = $(dataGrid.getCellElement(0, 1));
3363-
$secondCell.find('.dx-checkbox').trigger(pointerEvents.down);
3364-
this.clock.tick(10);
3365-
$secondCell = $(dataGrid.getCellElement(0, 1));
3366-
$secondCell.find('.dx-checkbox').trigger('dxclick');
3367-
this.clock.tick(10);
3368-
3369-
// assert
3370-
assert.strictEqual(dataGrid.cellValue(0, 0), '123', 'first cell value');
3371-
assert.strictEqual(dataGrid.cellValue(0, 1), false, 'second cell value');
3372-
});
3373-
});
3374-
33753323
// T1131810, T1102203
33763324
// Revert button should not rerendered on focus, because it makes cell unfocusable on iOS devices
33773325
QUnit.test('Cell - Revert button should not rerendered on focus', function(assert) {
@@ -5273,10 +5221,6 @@ QUnit.module('API methods', baseModuleConfig, () => {
52735221

52745222
// T553067
52755223
QUnit.testInActiveWindow('Enter key on editor should prevent default behaviour', function(assert) {
5276-
if(shouldSkipOnMobile(assert, 'keyboard navigation is disabled for non-desktop devices')) {
5277-
return;
5278-
}
5279-
52805224
// arrange
52815225
const dataGrid = createDataGrid({
52825226
dataSource: [{ name: 'name 1', value: 1 }, { name: 'name 2', value: 2 }],
@@ -5342,10 +5286,6 @@ QUnit.module('API methods', baseModuleConfig, () => {
53425286
});
53435287

53445288
QUnit.testInActiveWindow('Datebox editor\'s enter key handler should be replaced by noop (T819067)', function(assert) {
5345-
if(shouldSkipOnMobile(assert, 'keyboard navigation is disabled for non-desktop devices')) {
5346-
return;
5347-
}
5348-
53495289
// arrange
53505290
const rowsViewWrapper = dataGridWrapper.rowsView;
53515291
const dataGrid = createDataGrid({
@@ -5372,10 +5312,6 @@ QUnit.module('API methods', baseModuleConfig, () => {
53725312
});
53735313

53745314
QUnit.testInActiveWindow('Datebox changed value should be saved on enter key if useMaskBehaviour is true (T1070850)', function(assert) {
5375-
if(shouldSkipOnMobile(assert, 'keyboard navigation is disabled for non-desktop devices')) {
5376-
return;
5377-
}
5378-
53795315
// arrange
53805316
const rowsViewWrapper = dataGridWrapper.rowsView;
53815317
const dataGrid = createDataGrid({
@@ -5425,10 +5361,6 @@ QUnit.module('API methods', baseModuleConfig, () => {
54255361
['date', 'datetime'].forEach(dataType => {
54265362
[true, false].forEach(useMaskBehavior => {
54275363
QUnit.testInActiveWindow(`Datebox editor's value should be selected from calendar by keyboard (useMaskBehavior = ${useMaskBehavior}, dataType = ${dataType})`, function(assert) {
5428-
if(shouldSkipOnMobile(assert, 'keyboard navigation is disabled for non-desktop devices')) {
5429-
return;
5430-
}
5431-
54325364
// arrange
54335365
const rowsViewWrapper = dataGridWrapper.rowsView;
54345366
const dataGrid = createDataGrid({
@@ -5599,10 +5531,6 @@ QUnit.module('API methods', baseModuleConfig, () => {
55995531
});
56005532

56015533
QUnit.testInActiveWindow('Scroll positioned correct with fixed columns and editing', function(assert) {
5602-
if(shouldSkipOnMobile(assert, 'keyboard navigation is disabled for non-desktop devices')) {
5603-
return;
5604-
}
5605-
56065534
// arrange, act
56075535
const dataGrid = createDataGrid({
56085536
loadingTimeout: null,

0 commit comments

Comments
 (0)