Skip to content

Commit 542ee5c

Browse files
authored
Refactor test (#33004)
1 parent 67b2837 commit 542ee5c

5 files changed

Lines changed: 59 additions & 19 deletions
-31 Bytes
Loading
-1.93 KB
Loading
Loading
Loading

e2e/testcafe-devextreme/tests/dataGrid/sticky/common/withGrouping.ts

Lines changed: 59 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -289,33 +289,15 @@ test('DataGrid - Group row content is scrolled if repaintChangesOnly is enabled
289289

290290
[false, true].forEach((rtlEnabled) => {
291291
// T1284612
292-
test.meta({
293-
browserSize: [900, 800],
294-
unstable: true,
295-
})(`DataGrid - Group summaries are shown over sticky columns on a horizontal scroll (rtl=${rtlEnabled})`, async (t) => {
292+
test(`DataGrid - Group summaries are shown over sticky columns on a horizontal scroll - intersection (rtl=${rtlEnabled})`, async (t) => {
296293
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
297294

298295
const dataGrid = new DataGrid(DATA_GRID_SELECTOR);
299296

300297
await t.expect(dataGrid.isReady()).ok();
301298

302-
await dataGrid.scrollTo(t, { x: rtlEnabled ? 100 : 250 });
303-
await t.wait(300);
304299
await testScreenshot(t, takeScreenshot, `grouping-scroll-total_summary_intersection-rtl=${rtlEnabled}.png`, { element: dataGrid.element });
305300

306-
await dataGrid.apiOption('summary.totalItems', [{
307-
column: 'SaleAmount',
308-
summaryType: 'max',
309-
valueFormat: 'currency',
310-
}]);
311-
await t.wait(300);
312-
await dataGrid.scrollTo(t, { x: 0 });
313-
await t.wait(200);
314-
await dataGrid.scrollTo(t, { x: rtlEnabled ? 100 : 250 });
315-
await t.wait(300);
316-
317-
await testScreenshot(t, takeScreenshot, `grouping-scroll-total_summary-rtl=${rtlEnabled}.png`, { element: dataGrid.element });
318-
319301
await t
320302
.expect(compareResults.isValid())
321303
.ok(compareResults.errorMessages());
@@ -324,6 +306,8 @@ test('DataGrid - Group row content is scrolled if repaintChangesOnly is enabled
324306
rtlEnabled,
325307
customizeColumns(columns) {
326308
columns[2].groupIndex = 0;
309+
columns[1].visible = false;
310+
columns[3].width = 200;
327311
},
328312
summary: {
329313
groupItems: [{
@@ -370,3 +354,59 @@ test('DataGrid - Group row content is scrolled if repaintChangesOnly is enabled
370354
},
371355
}));
372356
});
357+
358+
[false, true].forEach((rtlEnabled) => {
359+
// T1284612
360+
test(`DataGrid - Group summaries are shown over sticky columns on a horizontal scroll (rtl=${rtlEnabled})`, async (t) => {
361+
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
362+
363+
const dataGrid = new DataGrid(DATA_GRID_SELECTOR);
364+
365+
await t.expect(dataGrid.isReady()).ok();
366+
367+
await testScreenshot(t, takeScreenshot, `grouping-scroll-total_summary-rtl=${rtlEnabled}.png`, { element: dataGrid.element });
368+
369+
await t
370+
.expect(compareResults.isValid())
371+
.ok(compareResults.errorMessages());
372+
}).before(async () => createWidget('dxDataGrid', {
373+
...defaultConfig,
374+
rtlEnabled,
375+
customizeColumns(columns) {
376+
columns[2].groupIndex = 0;
377+
columns[1].visible = false;
378+
columns[4].width = 150;
379+
},
380+
summary: {
381+
groupItems: [{
382+
column: 'OrderNumber',
383+
summaryType: 'count',
384+
displayFormat: '{0} orders',
385+
}, {
386+
column: 'City',
387+
summaryType: 'max',
388+
valueFormat: 'currency',
389+
showInGroupFooter: false,
390+
alignByColumn: true,
391+
}, {
392+
column: 'TotalAmount',
393+
summaryType: 'max',
394+
valueFormat: 'currency',
395+
showInGroupFooter: false,
396+
alignByColumn: true,
397+
}, {
398+
column: 'TotalAmount',
399+
summaryType: 'sum',
400+
valueFormat: 'currency',
401+
displayFormat: 'Total: {0}',
402+
showInGroupFooter: true,
403+
}],
404+
totalItems: [{
405+
column: 'SaleAmount',
406+
summaryType: 'max',
407+
valueFormat: 'currency',
408+
displayFormat: 'MAXMAXMAXMAX: {0}',
409+
}],
410+
},
411+
}));
412+
});

0 commit comments

Comments
 (0)