@@ -7,6 +7,13 @@ fixture.disablePageReloads`Appointment Form: Functional`
77
88const SCHEDULER_SELECTOR = '#container' ;
99
10+ const roughEqualClientBoundingRect = ( a : TextRectangle , b : TextRectangle ) : boolean => (
11+ Math . abs ( a . width - b . width ) < 1
12+ && Math . abs ( a . height - b . height ) < 1
13+ && Math . abs ( a . top - b . top ) < 1
14+ && Math . abs ( a . left - b . left ) < 1
15+ ) ;
16+
1017test ( 'Subject text editor should have focus after returning from recurrence form' , async ( t ) => {
1118 const appointment = {
1219 text : 'Appointment' ,
@@ -60,3 +67,73 @@ test('Recurrence start date editor should have focus after opening recurrence se
6067 currentDate : new Date ( 2021 , 2 , 25 ) ,
6168 } ) ;
6269} ) ;
70+
71+ test ( 'Popup should not change dimensions when switching groups and recurrence group height is larger' , async ( t ) => {
72+ const scheduler = new Scheduler ( SCHEDULER_SELECTOR ) ;
73+
74+ await scheduler . openAppointmentPopup ( t ) ;
75+ const boundingClientRect1 = await scheduler . appointmentPopup . contentElement . boundingClientRect ;
76+
77+ await scheduler . appointmentPopup . selectRepeatValue ( t , 'Weekly' ) ;
78+ const boundingClientRect2 = await scheduler . appointmentPopup . contentElement . boundingClientRect ;
79+
80+ await t . click ( scheduler . appointmentPopup . recurrence . backButton ) ;
81+ const boundingClientRect3 = await scheduler . appointmentPopup . contentElement . boundingClientRect ;
82+
83+ await t
84+ . expect ( roughEqualClientBoundingRect ( boundingClientRect1 , boundingClientRect2 ) ) . ok ( )
85+ . expect ( roughEqualClientBoundingRect ( boundingClientRect1 , boundingClientRect3 ) ) . ok ( ) ;
86+ } ) . before ( async ( ) => {
87+ await createWidget ( 'dxScheduler' , {
88+ dataSource : [ ] ,
89+ views : [ 'week' ] ,
90+ currentView : 'week' ,
91+ currentDate : new Date ( 2021 , 2 , 25 ) ,
92+ editing : {
93+ form : {
94+ items : [
95+ {
96+ name : 'mainGroup' ,
97+ items : [ 'repeatGroup' ] ,
98+ } ,
99+ 'recurrenceGroup' ,
100+ ] ,
101+ } ,
102+ } ,
103+ } ) ;
104+ } ) ;
105+
106+ test ( 'Popup should not change dimensions when switching groups and main group height is larger' , async ( t ) => {
107+ const scheduler = new Scheduler ( SCHEDULER_SELECTOR ) ;
108+
109+ await scheduler . openAppointmentPopup ( t ) ;
110+ const boundingClientRect1 = await scheduler . appointmentPopup . contentElement . boundingClientRect ;
111+
112+ await scheduler . appointmentPopup . selectRepeatValue ( t , 'Weekly' ) ;
113+ const boundingClientRect2 = await scheduler . appointmentPopup . contentElement . boundingClientRect ;
114+
115+ await t . click ( scheduler . appointmentPopup . recurrence . backButton ) ;
116+ const boundingClientRect3 = await scheduler . appointmentPopup . contentElement . boundingClientRect ;
117+
118+ await t
119+ . expect ( roughEqualClientBoundingRect ( boundingClientRect1 , boundingClientRect2 ) ) . ok ( )
120+ . expect ( roughEqualClientBoundingRect ( boundingClientRect1 , boundingClientRect3 ) ) . ok ( ) ;
121+ } ) . before ( async ( ) => {
122+ await createWidget ( 'dxScheduler' , {
123+ dataSource : [ ] ,
124+ views : [ 'week' ] ,
125+ currentView : 'week' ,
126+ currentDate : new Date ( 2021 , 2 , 25 ) ,
127+ editing : {
128+ form : {
129+ items : [
130+ 'mainGroup' ,
131+ {
132+ name : 'recurrenceGroup' ,
133+ items : [ 'recurrenceStartDateGroup' ] ,
134+ } ,
135+ ] ,
136+ } ,
137+ } ,
138+ } ) ;
139+ } ) ;
0 commit comments