-
Notifications
You must be signed in to change notification settings - Fork 667
DataGrid - Fix the "No data" text not being shown when a lookup column is filtered (T1293839) #32757
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
Open
markallenramirez
wants to merge
14
commits into
DevExpress:26_1
Choose a base branch
from
markallenramirez:bug_T1293839/26_1
base: 26_1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+56
−3
Open
DataGrid - Fix the "No data" text not being shown when a lookup column is filtered (T1293839) #32757
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e559fed
test
markallenramirez a0da72c
update test
markallenramirez f502f01
fix
markallenramirez 8e763ca
update test
markallenramirez 3a1c68e
etalon
markallenramirez 4ac6d93
update fix
markallenramirez d7997b1
Revert "update fix"
markallenramirez b0f6d6d
fix
markallenramirez 7d238f0
Revert "fix"
markallenramirez f200c9c
Revert "fix"
markallenramirez e66ecca
fix
markallenramirez ae7ef40
Revert "fix"
markallenramirez 0b68aaa
fix
markallenramirez 6b60431
fix
markallenramirez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+6.4 KB
...mmon/markup/etalons/T1293839-grid-no-data-text-rendered (fluent.blue.light).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; | ||
| import DataGrid from 'devextreme-testcafe-models/dataGrid'; | ||
| import List from 'devextreme-testcafe-models/list'; | ||
| import url from '../../../../helpers/getPageUrl'; | ||
| import { createWidget } from '../../../../helpers/createWidget'; | ||
| import { testScreenshot } from '../../../../helpers/themeUtils'; | ||
|
|
@@ -8,6 +9,58 @@ fixture.disablePageReloads`No Data` | |
| .page(url(__dirname, '../../../container.html')); | ||
|
|
||
| const GRID_CONTAINER = '#container'; | ||
| const OVERLAY_SELECTOR = '.dx-overlay-wrapper'; | ||
|
|
||
| test('The noDataText element should be rendered when a lookup column is filtered (T1293839)', async (t) => { | ||
| // arrange | ||
| const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
| const dataGrid = new DataGrid(GRID_CONTAINER); | ||
| const filterRow = dataGrid.getHeaders().getFilterRow(); | ||
| const nameFilterCell = filterRow.getFilterCell(0); | ||
| const nameFilterEditor = nameFilterCell.getEditorInput(); | ||
| const lookupFilterCell = filterRow.getFilterCell(1); | ||
|
|
||
| // act | ||
| await t.click(lookupFilterCell.element); | ||
| const lookupList = new List(OVERLAY_SELECTOR); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor comment: I suggest creating a getLookup/getSelectBox method at the FilterCell model level, which will return the SelectBox model. This model has the necessary API for testing. |
||
| const lookupItem = lookupList.getItem(1); | ||
| await t.click(lookupItem.element); | ||
| await t.typeText(nameFilterEditor.element, 'test'); | ||
|
|
||
| // assert | ||
| await t | ||
| .expect(dataGrid.isReady()) | ||
| .ok(); | ||
|
|
||
| await testScreenshot(t, takeScreenshot, 'T1293839-grid-no-data-text-rendered.png', { element: dataGrid.element }); | ||
| await t | ||
| .expect(compareResults.isValid()) | ||
| .ok(compareResults.errorMessages()); | ||
| }).before(async () => { | ||
| await createWidget('dxDataGrid', { | ||
| dataSource: [ | ||
| { ID: 1, Name: 'John', Lookup: 1 }, | ||
| { ID: 2, Name: 'Jane', Lookup: 2 }, | ||
| ], | ||
| keyExpr: 'ID', | ||
| columns: ['Name', { | ||
| dataField: 'Lookup', | ||
| lookup: { | ||
| dataSource: [ | ||
| { ID: 1, Text: 'Item 1' }, | ||
| { ID: 2, Text: 'Item 2' }, | ||
| ], | ||
| valueExpr: 'ID', | ||
| displayExpr: 'Text', | ||
| }, | ||
| }], | ||
| showBorders: true, | ||
| filterRow: { visible: true }, | ||
markallenramirez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| onEditorPreparing(e) { | ||
| e.updateValueTimeout = 0; | ||
| }, | ||
| }); | ||
| }); | ||
|
|
||
| test('The noDataText element should be centered (T1178289)', async (t) => { | ||
| const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 test interacts with the filter row immediately after creating the widget, but doesn’t assert the grid is ready first. Please add an
await t.expect(dataGrid.isReady()).ok();(or equivalent) before clicking/typing to avoid timing-related failures on slower CI runs.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.
not needed
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.
However, it is recommended to add this check since data is always loaded asynchronously (by default, within 30ms). Failure to do so may result in flickering tests.