-
Notifications
You must be signed in to change notification settings - Fork 658
DataGrid: Editing - replace QUnit test with Jest (T1293181) #31943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 25_2
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates a QUnit test case (T1293181) to Jest, converting it from the legacy test suite to a modern integration test. The test validates that a recovered (undeleted) row maintains correct data when positioned before an inserted row in batch editing mode.
Key Changes:
- Removed QUnit test from
editing.tests.js - Created new Jest integration test in
m_editing.integration.test.ts - Added helper methods
getRowDeleteButtonandgetRowRecoverButtonto the GridCoreModel test utility
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/devextreme/testing/tests/DevExpress.ui.widgets.dataGrid/editing.tests.js | Removed legacy QUnit test for T1293181 |
| packages/devextreme/js/__internal/grids/grid_core/editing/tests/m_editing.integration.test.ts | Added new Jest integration test for row recovery in batch editing |
| packages/devextreme/js/__internal/grids/grid_core/tests/mock/model/grid_core.ts | Added helper methods to access delete and recover buttons in test model |
| jest.useRealTimers(); | ||
| }; | ||
|
|
||
| describe('Unsupported filtering properties', () => { |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The describe block name "Unsupported filtering properties" is incorrect for this test suite about editing/recovery functionality. This appears to be copy-pasted from another test file (e.g., unsupported_filtering_properties.integration.test.ts).
The describe block should be renamed to something more appropriate like "Editing", "Batch editing", or "Row recovery in batch mode" to accurately reflect the test content.
| describe('Unsupported filtering properties', () => { | |
| describe('Batch editing and row recovery', () => { |
| } | ||
|
|
||
| public getRowDeleteButton(rowIndex: number): HTMLElement { | ||
| const row = this.getDataRows()[rowIndex]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems we can use getDataRow directly without indexer.
| return new EditFormModel(this.root.querySelector(`.${this.addWidgetPrefix(SELECTORS.editForm)}`)); | ||
| } | ||
|
|
||
| public getRowDeleteButton(rowIndex: number): HTMLElement { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be placed to the DataRow model
| return row.querySelector(`.${SELECTORS.deleteRowButton}`) as HTMLElement; | ||
| } | ||
|
|
||
| public getRowRecoverButton(rowIndex: number): HTMLElement { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same, it can be placed to the DataRow model
| jest.useRealTimers(); | ||
| }; | ||
|
|
||
| describe('Unsupported filtering properties', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with Copilot.
| const { component, instance } = await createDataGrid({ | ||
| keyExpr: 'ID', | ||
| dataSource, | ||
| columns, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we to inline column config? It would be easier to read the test.
| const rows = instance.getVisibleRows(); | ||
|
|
||
| expect(rows).toHaveLength(dataSource.length + 1); | ||
| expect(rows[recoveringRowIndex].data).toEqual(dataSource[recoveringRowIndex]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to check keys here?
No description provided.