@@ -7,9 +7,11 @@ import url from '../../../../../helpers/getPageUrl';
77fixture . disablePageReloads `Layout:Templates:CellTemplate`
88 . page ( url ( __dirname , '../../../../container.html' ) ) ;
99
10+ const SCHEDULER_SELECTOR = '#container' ;
11+
1012[ 'day' , 'workWeek' , 'month' , 'timelineDay' , 'timelineWorkWeek' , 'timelineMonth' ] . forEach ( ( currentView ) => {
1113 test ( `dataCellTemplate and dateCellTemplate layout should be rendered right in '${ currentView } '` , async ( t ) => {
12- const scheduler = new Scheduler ( '#container' ) ;
14+ const scheduler = new Scheduler ( SCHEDULER_SELECTOR ) ;
1315 const { takeScreenshot, compareResults } = createScreenshotsComparer ( t ) ;
1416
1517 await t
@@ -36,3 +38,28 @@ fixture.disablePageReloads`Layout:Templates:CellTemplate`
3638 } ) ;
3739 } ) ;
3840} ) ;
41+
42+ test ( 'Async dateCellTemplate should be rendered only once (T1251590)' , async ( t ) => {
43+ const scheduler = new Scheduler ( SCHEDULER_SELECTOR ) ;
44+
45+ const firstTableCell = scheduler . headerPanel . headerCells . nth ( 0 ) ;
46+
47+ await t . expect ( firstTableCell . textContent ) . eql ( 'TEST' ) ;
48+ } ) . before ( async ( ) => {
49+ await createWidget ( 'dxScheduler' , {
50+ dataSource : [
51+ {
52+ startDate : '2024-01-01T01:00:00' ,
53+ endDate : '2024-01-01T02:00:00' ,
54+ allDay : true ,
55+ } ,
56+ ] ,
57+ currentDate : '2024-01-01' ,
58+ currentView : 'week' ,
59+ dateCellTemplate : ClientFunction ( ( _ , __ , itemElement ) => {
60+ setTimeout ( ( ) => {
61+ itemElement . append ( 'TEST' ) ;
62+ } , 0 ) ;
63+ } ) ,
64+ } ) ;
65+ } ) ;
0 commit comments