Skip to content
Merged
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 @@ -167,6 +167,8 @@ const checkCellFocused = async (
}

await t
.expect(editor?.element.exists)
.ok()
.expect(editor?.element.focused)
.eql(true);
Comment thread
anna-shakhova marked this conversation as resolved.
};
Expand Down Expand Up @@ -441,6 +443,8 @@ editingModes.forEach((mode) => {
const cell = dataGrid.getDataCell(0, columnInfo.columnIndex);
const editor = form ? new CellEditor(form.getItem(columnInfo.dataField)) : cell.getEditor();

await t.expect(dataGrid.isReady()).ok();

await clickCellEditor(t, mode, columnInfo, form, cell, editor);
await setEditorValue(t, mode, columnInfo, editor);

Expand Down Expand Up @@ -569,12 +573,14 @@ editingModes.forEach((mode) => {
}));

[true, false].forEach((repaintChangesOnly) => {
test.meta({ unstable: mode === 'batch' && !repaintChangesOnly })(
test(
`Update cell value and focus next cell, mode: ${mode}, repaintChangesOnly: ${repaintChangesOnly}, useKeyboard: false`,
async (t) => {
const form = getEditForm(mode);
let modifiedCellCount = mode === 'batch' ? 1 : 0;

await t.expect(dataGrid.isReady()).ok();

for (const columnInfo of textColumnInfos) {
const cell = dataGrid.getDataCell(0, columnInfo.columnIndex);
const editor = form
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ test('Async Validation(Row) - Data is not saved when a dependant cell value beco

test('Async Validation(Cell) - Only the last cell should be switched to edit mode', async (t) => {
const dataGrid = new DataGrid('#container');
const resolveValidation = ClientFunction(() => (window as any).deferred.resolve(true));

await t.expect(dataGrid.isReady()).ok();

const cell0 = dataGrid.getDataCell(0, 0);
Expand All @@ -374,33 +376,43 @@ test('Async Validation(Cell) - Only the last cell should be switched to edit mod
.click(cell1.element)
.expect(cell1.isFocused)
.notOk('the second cell should not be focused')
.click(cell2.element)
.click(cell2.element);

await resolveValidation();

await t
.expect(cell0.isValidationPending)
.notOk('validating is completed')
.expect(cell2.hasHiddenFocusState)
.notOk()
.expect(cell2.isFocused)
.ok('the third cell should be focused');
}).before(async () => createWidget('dxDataGrid', getGridConfig({
editing: {
mode: 'cell',
allowUpdating: true,
allowAdding: true,
},
columns: [{
dataField: 'age',
validationRules: [{
type: 'async',
validationCallback(): JQueryPromise<unknown> {
const d = $.Deferred();
setTimeout(() => {
d.resolve(true);
}, 1000);
return d.promise();
},
}],
}, 'name', 'lastName'],
})));
}).before(async () => {
await ClientFunction(() => {
(window as any).deferred = $.Deferred();
})();

return createWidget('dxDataGrid', getGridConfig({
editing: {
mode: 'cell',
allowUpdating: true,
allowAdding: true,
},
columns: [{
dataField: 'age',
validationRules: [{
type: 'async',
validationCallback(): JQueryPromise<unknown> {
return (window as any).deferred.promise();
},
}],
}, 'name', 'lastName'],
}));
}).after(async () => {
await ClientFunction(() => {
delete (window as any).deferred;
})();
});

test('Async Validation(Cell) - Only valid data is saved in a new row', async (t) => {
const dataGrid = new DataGrid('#container');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1703,6 +1703,8 @@ test('The expand cell should not lose focus on expanding a master row (T892203)'
.click(addRowButton)

.expect(cell00.isFocused).ok()
.expect(editor00.element.exists)
.ok()
.expect(editor00.element.focused)
.ok()

Expand All @@ -1715,6 +1717,8 @@ test('The expand cell should not lose focus on expanding a master row (T892203)'
.eql('1')
.expect(cell01.isFocused)
.ok()
.expect(editor01.element.exists)
.ok()
.expect(editor01.element.focused)
.ok()

Expand Down Expand Up @@ -1749,6 +1753,8 @@ test('The expand cell should not lose focus on expanding a master row (T892203)'
.click(cell01.element)

.expect(cell01.isFocused).ok()
.expect(editor01.element.exists)
.ok()
.expect(editor01.element.focused)
.ok()

Expand All @@ -1761,6 +1767,8 @@ test('The expand cell should not lose focus on expanding a master row (T892203)'
.eql('2')
.expect(cell00.isFocused)
.ok()
.expect(editor00.element.exists)
.ok()
.expect(editor00.element.focused)
.ok()

Expand All @@ -1780,7 +1788,7 @@ test('The expand cell should not lose focus on expanding a master row (T892203)'
columns: ['a', 'b'],
}));

test.meta({ unstable: editMode === 'Cell' })(`${editMode} mode - Cells in a modified row should be updated on Tab (T898356)`, async (t) => {
test(`${editMode} mode - Cells in a modified row should be updated on Tab (T898356)`, async (t) => {
const dataGrid = new DataGrid('#container') as any;
const cell00 = dataGrid.getDataCell(0, 0);
const editor00 = cell00.getEditor();
Expand All @@ -1793,6 +1801,8 @@ test('The expand cell should not lose focus on expanding a master row (T892203)'
.click(cell00.element)

.expect(cell00.isFocused).ok()
.expect(editor00.element.exists)
.ok()
.expect(editor00.element.focused)
.ok()

Expand All @@ -1805,6 +1815,8 @@ test('The expand cell should not lose focus on expanding a master row (T892203)'
.eql('11')
.expect(cell01.isFocused)
.ok()
.expect(editor01.element.exists)
.ok()
.expect(editor01.element.focused)
.ok()

Expand Down Expand Up @@ -1837,6 +1849,8 @@ test('The expand cell should not lose focus on expanding a master row (T892203)'
.click(cell01.element)

.expect(cell01.isFocused).ok()
.expect(editor01.element.exists)
.ok()
.expect(editor01.element.focused)
.ok()

Expand All @@ -1849,6 +1863,8 @@ test('The expand cell should not lose focus on expanding a master row (T892203)'
.eql('22')
.expect(cell00.isFocused)
.ok()
.expect(editor00.element.exists)
.ok()
.expect(editor00.element.focused)
.ok()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,17 @@ test.meta({ browserSize: [800, 800] })('The form edit mode: Edit row when there
},
}));

test.meta({ browserSize: [800, 800] })('The batch edit mode: Edit cell whene there are sticky columns', async (t) => {
test.meta({ browserSize: [800, 800] })('The batch edit mode: Edit cell when there are sticky columns', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const dataGrid = new DataGrid(DATA_GRID_SELECTOR);

await t.expect(dataGrid.isReady()).ok();

await t.click(dataGrid.getDataCell(0, 2).element);
const editCell = dataGrid.getDataCell(0, 2);
await t.click(editCell.element);
await t
.expect(editCell.isEditCell).ok()
.expect(editCell.getEditor().element.focused).ok();

await testScreenshot(t, takeScreenshot, 'edit_cell_with_sticky_columns_1.png', { element: dataGrid.element });

Expand Down
Loading