@@ -7,6 +7,8 @@ import url from '../../../helpers/getPageUrl';
77import { createWidget } from '../../../helpers/createWidget' ;
88import { safeSizeTest } from '../../../helpers/safeSizeTest' ;
99import { salesApiMock } from './apiMocks/salesApiMock' ;
10+ import { changeTheme } from '../../../helpers/changeTheme' ;
11+ import { Themes } from '../../../helpers/themes' ;
1012
1113async function getMaxRightOffset ( dataGrid : DataGrid ) : Promise < number > {
1214 const scrollWidth = await dataGrid . getScrollWidth ( ) ;
@@ -1909,3 +1911,70 @@ test('DataGrid - The "row" parameter in the FocusedRowChanged event refers to a
19091911 delete ( window as TestCaseWindow ) . dataGridScrollableEventValues ;
19101912 } ) ) ;
19111913} ) ;
1914+
1915+ // T1270354
1916+ [
1917+ { theme : Themes . genericLight , useNative : true } ,
1918+ { theme : Themes . genericLight , useNative : false } ,
1919+ { theme : Themes . materialBlue , useNative : true } ,
1920+ { theme : Themes . materialBlue , useNative : false } ,
1921+ { theme : Themes . fluentBlue , useNative : true } ,
1922+ { theme : Themes . fluentBlue , useNative : false } ,
1923+ ] . forEach ( ( { theme, useNative } ) => {
1924+ test ( `Virtual ${ useNative ? 'native' : 'simulated' } scrolling - Scrolling to the bottom should work correctly when there is a grouping and a summary (${ theme } theme)` , async ( t ) => {
1925+ const dataGrid = new DataGrid ( '#container' ) ;
1926+ const { takeScreenshot, compareResults } = createScreenshotsComparer ( t ) ;
1927+
1928+ await t
1929+ . expect ( dataGrid . isReady ( ) )
1930+ . ok ( ) ;
1931+
1932+ await dataGrid . scrollBy ( { y : 10000 } ) ;
1933+
1934+ await t
1935+ . expect ( await takeScreenshot ( `T1270354-virtual-${ useNative ? 'native' : 'simulated' } -scrolling-with-grouping-and-summary-${ theme } .png` , '#container' ) )
1936+ . ok ( )
1937+ . expect ( compareResults . isValid ( ) )
1938+ . ok ( compareResults . errorMessages ( ) ) ;
1939+ } )
1940+ . before ( async ( ) => {
1941+ await changeTheme ( theme ) ;
1942+ await createWidget ( 'dxDataGrid' , {
1943+ dataSource : [ ...new Array ( 50 ) ]
1944+ . fill ( null )
1945+ . map ( ( _ , index ) => ( {
1946+ id : index ,
1947+ machine : index ,
1948+ totalTime : 1 ,
1949+ } ) ) ,
1950+ keyExpr : 'id' ,
1951+ showBorders : true ,
1952+ height : 400 ,
1953+ width : '100%' ,
1954+ columns : [
1955+ {
1956+ dataField : 'machine' ,
1957+ groupIndex : 0 ,
1958+ } , {
1959+ dataField : 'totalTime' ,
1960+ } ,
1961+ ] ,
1962+ scrolling : {
1963+ mode : 'virtual' ,
1964+ useNative,
1965+ } ,
1966+ grouping : {
1967+ autoExpandAll : false ,
1968+ } ,
1969+ summary : {
1970+ totalItems : [
1971+ {
1972+ column : 'totalTime' ,
1973+ summaryType : 'sum' ,
1974+ } ,
1975+ ] ,
1976+ } ,
1977+ } ) ;
1978+ } )
1979+ . after ( async ( ) => changeTheme ( Themes . genericLight ) ) ;
1980+ } ) ;
0 commit comments