Skip to content

Commit cf61bee

Browse files
committed
tests refactoring
1 parent 6b39b90 commit cf61bee

1 file changed

Lines changed: 17 additions & 19 deletions

File tree

  • packages/devextreme/testing/tests/DevExpress.ui.widgets/listParts

packages/devextreme/testing/tests/DevExpress.ui.widgets/listParts/commonTests.js

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5277,34 +5277,32 @@ QUnit.module('Accessibility', () => {
52775277
});
52785278

52795279
[true, false].forEach(repaintChangesOnly => {
5280-
['items', 'dataSource'].forEach(source => {
5281-
QUnit.test(`scrollview-content should not have role when ${source} is empty on init and repaintChangesOnly=${repaintChangesOnly} (T1329047)`, function(assert) {
5282-
const instance = $('#list').dxList({ [source]: [], repaintChangesOnly }).dxList('instance');
5280+
QUnit.test(`scrollview-content should not have role when dataSource is empty on init and repaintChangesOnly=${repaintChangesOnly} (T1329047)`, function(assert) {
5281+
const instance = $('#list').dxList({ dataSource: [], repaintChangesOnly }).dxList('instance');
52835282

5284-
assert.strictEqual(instance.$element().find(`.${SCROLLVIEW_CONTENT_CLASS}`).get(0).getAttribute('role'), null);
5285-
});
5283+
assert.strictEqual(instance.$element().find(`.${SCROLLVIEW_CONTENT_CLASS}`).eq(0).attr('role'), undefined);
5284+
});
52865285

5287-
QUnit.test(`scrollview-content should have role="application" when ${source} has items on init and repaintChangesOnly=${repaintChangesOnly} (T1329047)`, function(assert) {
5288-
const instance = $('#list').dxList({ [source]: ['Item 1'], repaintChangesOnly }).dxList('instance');
5286+
QUnit.test(`scrollview-content should have role="application" when dataSource has items on init and repaintChangesOnly=${repaintChangesOnly} (T1329047)`, function(assert) {
5287+
const instance = $('#list').dxList({ dataSource: ['Item 1'], repaintChangesOnly }).dxList('instance');
52895288

5290-
assert.strictEqual(instance.$element().find(`.${SCROLLVIEW_CONTENT_CLASS}`).get(0).getAttribute('role'), 'application');
5291-
});
5289+
assert.strictEqual(instance.$element().find(`.${SCROLLVIEW_CONTENT_CLASS}`).eq(0).attr('role'), 'application');
5290+
});
52925291

5293-
QUnit.test(`scrollview-content role should be removed when ${source} are removed in realtime and repaintChangesOnly=${repaintChangesOnly} (T1329047)`, function(assert) {
5294-
const instance = $('#list').dxList({ [source]: ['Item 1'], repaintChangesOnly }).dxList('instance');
5292+
QUnit.test(`scrollview-content role should be removed when dataSource are removed in realtime and repaintChangesOnly=${repaintChangesOnly} (T1329047)`, function(assert) {
5293+
const instance = $('#list').dxList({ dataSource: ['Item 1'], repaintChangesOnly }).dxList('instance');
52955294

5296-
instance.option(source, []);
5295+
instance.option('dataSource', []);
52975296

5298-
assert.strictEqual(instance.$element().find(`.${SCROLLVIEW_CONTENT_CLASS}`).get(0).getAttribute('role'), null);
5299-
});
5297+
assert.strictEqual(instance.$element().find(`.${SCROLLVIEW_CONTENT_CLASS}`).eq(0).attr('role'), undefined);
5298+
});
53005299

5301-
QUnit.test(`scrollview-content role should be restored when ${source} are added in realtime and repaintChangesOnly=${repaintChangesOnly} (T1329047)`, function(assert) {
5302-
const instance = $('#list').dxList({ [source]: [], repaintChangesOnly }).dxList('instance');
5300+
QUnit.test(`scrollview-content role should be restored when dataSource are added in realtime and repaintChangesOnly=${repaintChangesOnly} (T1329047)`, function(assert) {
5301+
const instance = $('#list').dxList({ dataSource: [], repaintChangesOnly }).dxList('instance');
53035302

5304-
instance.option(source, ['Item 1']);
5303+
instance.option('dataSource', ['Item 1']);
53055304

5306-
assert.strictEqual(instance.$element().find(`.${SCROLLVIEW_CONTENT_CLASS}`).get(0).getAttribute('role'), 'application');
5307-
});
5305+
assert.strictEqual(instance.$element().find(`.${SCROLLVIEW_CONTENT_CLASS}`).eq(0).attr('role'), 'application');
53085306
});
53095307
});
53105308
});

0 commit comments

Comments
 (0)