-
Notifications
You must be signed in to change notification settings - Fork 670
Grids stabilize tests after toolbar KBN changes #34364
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
Changes from all commits
5d237ab
bf2e07f
5e3da68
3602cb4
b55c84c
8ae2a3f
90408d3
a3f2c11
977fcf6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,97 +4,108 @@ import url from '../../../../helpers/getPageUrl'; | |
| import { createWidget } from '../../../../helpers/createWidget'; | ||
| import { MouseAction, MouseUpEvents } from '../../../../helpers/mouseUpEvents'; | ||
| import { testScreenshot } from '../../../../helpers/themeUtils'; | ||
| import { insertStylesToSuppressGroupPanelFocusOutline } from '../../helpers/domUtils'; | ||
| import { removeStylesheetRulesFromPage } from '../../../../helpers/domUtils'; | ||
|
|
||
| fixture.disablePageReloads`Column reordering.Visual` | ||
| .page(url(__dirname, '../../../container.html')); | ||
|
|
||
| test.skip('column separator should work properly with expand columns', async (t) => { | ||
| test('column separator should work properly with expand columns', async (t) => { | ||
| const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
| const dataGrid = new DataGrid('#container'); | ||
|
|
||
| await t.expect(dataGrid.isReady()).ok(); | ||
| await MouseUpEvents.disable(MouseAction.dragToOffset); | ||
|
|
||
| await t.drag(dataGrid.getGroupPanel().getHeader(0).element, 0, 30); | ||
| await testScreenshot(t, takeScreenshot, 'column-separator-with-expand-columns.png'); | ||
| await t | ||
| .expect(compareResults.isValid()) | ||
| .ok(compareResults.errorMessages()); | ||
| }).before(async () => { | ||
| await MouseUpEvents.disable(MouseAction.dragToOffset); | ||
| await insertStylesToSuppressGroupPanelFocusOutline(); | ||
|
|
||
| await MouseUpEvents.enable(MouseAction.dragToOffset); | ||
| }).before(async () => createWidget('dxDataGrid', { | ||
| width: 800, | ||
| dataSource: [ | ||
| { | ||
| field1: 'test1', field2: 'test2', field3: 'test3', field4: 'test4', | ||
| }, | ||
| ], | ||
| groupPanel: { | ||
| visible: true, | ||
| }, | ||
| columns: [ | ||
| { | ||
| dataField: 'field1', | ||
| width: 200, | ||
| groupIndex: 0, | ||
| }, { | ||
| dataField: 'field2', | ||
| width: 200, | ||
| groupIndex: 1, | ||
| }, { | ||
| dataField: 'field3', | ||
| width: 200, | ||
| }, { | ||
| dataField: 'field4', | ||
| width: 200, | ||
| return createWidget('dxDataGrid', { | ||
| width: 800, | ||
| dataSource: [ | ||
| { | ||
| field1: 'test1', field2: 'test2', field3: 'test3', field4: 'test4', | ||
| }, | ||
| ], | ||
| groupPanel: { | ||
| visible: true, | ||
| }, | ||
| ], | ||
| allowColumnReordering: true, | ||
| })); | ||
| columns: [ | ||
| { | ||
| dataField: 'field1', | ||
| width: 200, | ||
| groupIndex: 0, | ||
| }, { | ||
| dataField: 'field2', | ||
| width: 200, | ||
| groupIndex: 1, | ||
| }, { | ||
| dataField: 'field3', | ||
| width: 200, | ||
| }, { | ||
| dataField: 'field4', | ||
| width: 200, | ||
| }, | ||
| ], | ||
| allowColumnReordering: true, | ||
| }); | ||
| }).after(async () => { | ||
| await MouseUpEvents.enable(MouseAction.dragToOffset); | ||
| await removeStylesheetRulesFromPage(); | ||
| }); | ||
|
|
||
| test('HeaderRow should be highlighted when dragging column with allowColumnReordering=false', async (t) => { | ||
| const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
| const dataGrid = new DataGrid('#container'); | ||
| await t.expect(dataGrid.isReady()).ok(); | ||
|
|
||
| await MouseUpEvents.disable(MouseAction.dragToOffset); | ||
|
|
||
| await t.drag(dataGrid.getGroupPanel().getHeader(0).element, 0, 30); | ||
| await testScreenshot(t, takeScreenshot, 'headerRow-highlight-on-drag.png'); | ||
| await t | ||
| .expect(compareResults.isValid()) | ||
| .ok(compareResults.errorMessages()); | ||
| }).before(async () => { | ||
| await MouseUpEvents.disable(MouseAction.dragToOffset); | ||
| await insertStylesToSuppressGroupPanelFocusOutline(); | ||
|
|
||
| await MouseUpEvents.enable(MouseAction.dragToOffset); | ||
| }).before(async () => createWidget('dxDataGrid', { | ||
| width: 800, | ||
| dataSource: [ | ||
| { | ||
| field1: 'test1', field2: 'test2', field3: 'test3', field4: 'test4', | ||
| }, | ||
| ], | ||
| groupPanel: { | ||
| visible: true, | ||
| }, | ||
| columns: [ | ||
| { | ||
| dataField: 'field1', | ||
| width: 200, | ||
| groupIndex: 0, | ||
| }, { | ||
| dataField: 'field2', | ||
| width: 200, | ||
| groupIndex: 1, | ||
| }, { | ||
| dataField: 'field3', | ||
| width: 200, | ||
| }, { | ||
| dataField: 'field4', | ||
| width: 200, | ||
| return createWidget('dxDataGrid', { | ||
| width: 800, | ||
| dataSource: [ | ||
| { | ||
| field1: 'test1', field2: 'test2', field3: 'test3', field4: 'test4', | ||
| }, | ||
| ], | ||
| groupPanel: { | ||
| visible: true, | ||
| }, | ||
| ], | ||
| allowColumnReordering: false, | ||
| })); | ||
| columns: [ | ||
| { | ||
| dataField: 'field1', | ||
| width: 200, | ||
| groupIndex: 0, | ||
| }, { | ||
| dataField: 'field2', | ||
| width: 200, | ||
| groupIndex: 1, | ||
| }, { | ||
| dataField: 'field3', | ||
| width: 200, | ||
| }, { | ||
| dataField: 'field4', | ||
| width: 200, | ||
| }, | ||
| ], | ||
| allowColumnReordering: false, | ||
| }); | ||
| }).after(async () => { | ||
| await MouseUpEvents.enable(MouseAction.dragToOffset); | ||
| await removeStylesheetRulesFromPage(); | ||
| }); | ||
|
|
||
| test('The group separator should not appear when dragging a grouped column to the same position', async (t) => { | ||
|
Contributor
Author
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. this test was not flaky, but its test case is similar to the flaky one, so I have added styles to prevent its flakiness in the future |
||
| const dataGrid = new DataGrid('#container'); | ||
|
|
@@ -110,6 +121,7 @@ test('The group separator should not appear when dragging a grouped column to th | |
| .ok(compareResults.errorMessages()); | ||
| }).before(async () => { | ||
| await MouseUpEvents.disable(MouseAction.dragToOffset); | ||
| await insertStylesToSuppressGroupPanelFocusOutline(); | ||
|
|
||
| return createWidget('dxDataGrid', { | ||
| width: 800, | ||
|
|
@@ -141,4 +153,5 @@ test('The group separator should not appear when dragging a grouped column to th | |
| }); | ||
| }).after(async () => { | ||
| await MouseUpEvents.enable(MouseAction.dragToOffset); | ||
| await removeStylesheetRulesFromPage(); | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,8 @@ import url from '../../../../helpers/getPageUrl'; | |
| import { defaultConfig } from '../helpers/data'; | ||
| import { MouseAction, MouseUpEvents } from '../../../../helpers/mouseUpEvents'; | ||
| import { testScreenshot } from '../../../../helpers/themeUtils'; | ||
| import { removeStylesheetRulesFromPage } from '../../../../helpers/domUtils'; | ||
| import { insertStylesToSuppressGroupPanelFocusOutline } from '../../helpers/domUtils'; | ||
|
|
||
| const DATA_GRID_SELECTOR = '#container'; | ||
|
|
||
|
|
@@ -181,22 +183,24 @@ test.meta({ browserSize: [900, 800] })('Sticky columns with grouping - overflow | |
| // visual: generic.light | ||
| // visual: material.blue.light | ||
| // visual: fluent.blue.light | ||
| test.meta({ browserSize: [900, 800] })('The header row should be highlighted correctly when dragging column when there are fixed columns and allowColumnReordering=false (generic.light theme)', async (t) => { | ||
| test.meta({ browserSize: [900, 800] })('The header row should be highlighted correctly when dragging column when there are fixed columns and allowColumnReordering=false', async (t) => { | ||
| const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
| const dataGrid = new DataGrid('#container'); | ||
|
|
||
| await t.expect(dataGrid.isReady()).ok(); | ||
| await t.wait(300); | ||
|
|
||
| await t.drag(dataGrid.getGroupPanel().getHeader(0).element, 200, 35); | ||
| await t.wait(200); | ||
|
|
||
| await t.expect(dataGrid.getHeaders().getHeaderRow(0).isHighlighted()).ok(); | ||
|
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. is the outline override still needed now that the explicit
Contributor
Author
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. Yes, it's still needed. I have added |
||
|
|
||
| await testScreenshot(t, takeScreenshot, 'header_row_highlight_with_fixed_columns.png', { element: dataGrid.element }); | ||
|
|
||
| await t | ||
| .expect(compareResults.isValid()) | ||
| .ok(compareResults.errorMessages()); | ||
| }).before(async () => { | ||
| await MouseUpEvents.disable(MouseAction.dragToOffset); | ||
| await insertStylesToSuppressGroupPanelFocusOutline(); | ||
|
|
||
| return createWidget('dxDataGrid', { | ||
| ...defaultConfig, | ||
|
|
@@ -210,6 +214,7 @@ test.meta({ browserSize: [900, 800] })('The header row should be highlighted cor | |
| }); | ||
| }).after(async () => { | ||
| await MouseUpEvents.enable(MouseAction.dragToOffset); | ||
| await removeStylesheetRulesFromPage(); | ||
| }); | ||
|
|
||
| test.meta({ browserSize: [900, 800] })('The group separator should be visible when dragging a fixed column into the group panel', async (t) => { | ||
|
|
||
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.
this test was not flaky, but its test case is similar to the flaky one, so I have added styles to prevent its flakiness in the future