Skip to content

Commit 7152bce

Browse files
qunit
1 parent 9fec0b5 commit 7152bce

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

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

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3314,6 +3314,41 @@ QUnit.module('Focused row', getModuleConfig(true), () => {
33143314
assert.equal(focusedCellChangedCount, 1, 'onFocusedCellChanged fires count');
33153315
});
33163316

3317+
QUnit.testInActiveWindow('T1282664', function(assert) {
3318+
// arrange
3319+
const that = this;
3320+
let focusedCellChangedCount = 0;
3321+
this.data = [
3322+
{ id: 1, text: 'item 1' },
3323+
{ id: 2, text: 'item 2' },
3324+
];
3325+
this.options = {
3326+
keyExpr: 'id',
3327+
columns: ['id', 'text'],
3328+
onFocusedCellChanged: function(e) {
3329+
++focusedCellChangedCount;
3330+
3331+
// assert
3332+
assert.deepEqual($(e.cellElement).text(), $(that.getCellElement(0, 0)).text(), 'Cell element');
3333+
assert.deepEqual(e.columnIndex, 0, 'Column index');
3334+
assert.deepEqual(e.row.data, { id: 1, text: 'item 1' }, 'Row data');
3335+
assert.deepEqual(e.rowIndex, 0, 'Row index');
3336+
}
3337+
};
3338+
3339+
this.setupModule();
3340+
3341+
this.gridView.render($('#container'));
3342+
this.clock.tick(10);
3343+
3344+
// act
3345+
const columnHeadersView = this.gridView.getView('columnHeadersView');
3346+
this.triggerKeyDown('tab', false, false, columnHeadersView.getHeaderElement(1));
3347+
3348+
// assert
3349+
assert.equal(focusedCellChangedCount, 1, 'onFocusedCellChanged fires count');
3350+
});
3351+
33173352
// T755462
33183353
QUnit.testInActiveWindow('The page with focused row should load without errors after sorting the boolean column', function(assert) {
33193354
// arrange

0 commit comments

Comments
 (0)