-
Notifications
You must be signed in to change notification settings - Fork 600
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9bbb83
commit 39a0e35
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import createWidget from '../../../helpers/createWidget'; | ||
import url from '../../../helpers/getPageUrl'; | ||
import DataGrid from '../../../model/dataGrid'; | ||
|
||
fixture`Test name` | ||
.page(url(__dirname, '../../container.html')); | ||
|
||
// T1186997 | ||
|
||
[{ | ||
name: 't1', | ||
expected: true, | ||
onRowUpdating(e: { cancel: Promise<unknown> }) { | ||
e.cancel = new Promise((resolve) => { | ||
setTimeout(() => resolve(true), 0); | ||
}); | ||
}, | ||
}, { | ||
name: 't2', | ||
expected: true, | ||
onRowUpdating(e: { cancel: boolean }) { | ||
e.cancel = true; | ||
}, | ||
}].forEach(({ name, expected, onRowUpdating }) => { | ||
test(`test5 ${name}`, async (t) => { | ||
const dataGrid = new DataGrid('#container'); | ||
const dataRow = dataGrid.getDataRow(0); | ||
|
||
await t.click(dataRow.getDataCell(1).getLinkEdit()); | ||
|
||
await t | ||
.typeText(dataRow.getDataCell(0).getEditor().element, 'test text') | ||
.click(dataRow.getDataCell(1).getLinkSave()); | ||
|
||
await t.expect(dataRow.getDataCell(1).getLinkSave().exists).eql(expected); | ||
}).before(async () => { | ||
await createWidget('dxDataGrid', () => ({ | ||
dataSource: [{ | ||
ID: 1, | ||
FirstName: 'John', | ||
}, | ||
], | ||
columns: [{ | ||
dataField: 'FirstName', | ||
caption: 'Firs tName', | ||
}], | ||
height: 400, | ||
editing: { | ||
mode: 'row', | ||
allowUpdating: true, | ||
// allowDeleting: true, | ||
// allowAdding: true, | ||
}, | ||
onRowUpdating, | ||
})); | ||
}); | ||
}); |