Skip to content

Commit

Permalink
Data Grid - fix HeaderFilter + alternate rows
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanblinov2k17 committed Oct 1, 2024
1 parent 1cccf01 commit c41f67d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import DataGrid from 'devextreme-testcafe-models/dataGrid';
import FilterTextBox from 'devextreme-testcafe-models/dataGrid/editors/filterTextBox';
import { createWidget } from '../../../helpers/createWidget';
import url from '../../../helpers/getPageUrl';
import { safeSizeTest } from '../../../helpers/safeSizeTest';

fixture`Header Filter T1163100 change filter icon`
.page(url(__dirname, '../../container.html'));
Expand Down Expand Up @@ -30,7 +31,7 @@ const generateTestData = (rowCount: number) => new Array(rowCount)
['usual', undefined],
['virtual', { columnRenderingMode: 'virtual', rowRenderingMode: 'virtual' }],
] as const).forEach(([scrollingName, scrolling]) => {
test(`Should change filter row icon (columns ${firstColumnsName} ${secondColumnsName}, scrolling ${scrollingName}`, async (t) => {
safeSizeTest(`Should change filter row icon (columns ${firstColumnsName} ${secondColumnsName}, scrolling ${scrollingName}`, async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const dataGrid = new DataGrid(GRID_SELECTOR);

Expand All @@ -48,7 +49,7 @@ const generateTestData = (rowCount: number) => new Array(rowCount)

await t.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => createWidget('dxDataGrid', {
}, [1200, 800]).before(async () => createWidget('dxDataGrid', {
dataSource: generateTestData(25),
filterRow: {
visible: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
import DataGrid from 'devextreme-testcafe-models/dataGrid';
import { createWidget } from '../../../helpers/createWidget';
import url from '../../../helpers/getPageUrl';
import { safeSizeTest } from '../../../helpers/safeSizeTest';

fixture.disablePageReloads`Grouping Panel - Borders with enabled alternate rows`
.page(url(__dirname, '../../container.html'));
Expand All @@ -14,7 +15,7 @@ const generateData = (rowCount) => new Array(rowCount).fill(null).map((_, idx) =
C: `C_${idx}`,
}));

test('Alternate rows should be the same size', async (t) => {
safeSizeTest('Alternate rows should be the same size', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const dataGrid = new DataGrid(GRID_SELECTOR);

Expand All @@ -25,7 +26,7 @@ test('Alternate rows should be the same size', async (t) => {

await t.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => createWidget('dxDataGrid', {
}, [1200, 800]).before(async () => createWidget('dxDataGrid', {
dataSource: generateData(10),
columns: ['A', 'B', {
dataField: 'C',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { changeTheme } from '../../../../helpers/changeTheme';
import { createWidget } from '../../../../helpers/createWidget';
import url from '../../../../helpers/getPageUrl';
import { Themes } from '../../../../helpers/themes';
import { safeSizeTest } from '../../../../helpers/safeSizeTest';

// TODO: Enable multi-theming testcafe run in the future.
fixture.disablePageReloads`Grouping Panel - Borders with enabled alternate rows`
Expand Down Expand Up @@ -146,7 +147,7 @@ const createDataGrid = async ({
};

const markupTest = (matrixOptions) => {
test(`Should show group panel borders with ${getTestParams(matrixOptions)}`, async (t) => {
safeSizeTest(`Should show group panel borders with ${getTestParams(matrixOptions)}`, async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const dataGrid = new DataGrid(GRID_SELECTOR);
const rowIdx = matrixOptions.hasMasterDetail ? 8 : 5;
Expand All @@ -163,7 +164,7 @@ const markupTest = (matrixOptions) => {

await t.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => {
}, [1200, 800]).before(async () => {
await changeTheme(matrixOptions.theme);
await createDataGrid(matrixOptions);
}).after(async () => changeTheme(Themes.genericLight));
Expand Down

0 comments on commit c41f67d

Please sign in to comment.