@@ -377,79 +377,18 @@ describe('Appointment Form', () => {
377377 } ) ;
378378
379379 describe ( 'State' , ( ) => {
380- it ( 'should have empty description, subject and timezone inputs when opening second common appointment' , async ( ) => {
381- const { scheduler, POM } = await createScheduler ( {
382- ...getDefaultConfig ( ) ,
383- editing : {
384- allowUpdating : true ,
385- allowTimeZoneEditing : true ,
386- } ,
387- } ) ;
388-
389- scheduler . showAppointmentPopup ( { ...commonAppointment } ) ;
390-
391- POM . popup . setInputValue ( 'descriptionEditor' , 'temp' ) ;
392- POM . popup . setInputValue ( 'startDateTimeZoneEditor' , 'America/Los_Angeles' ) ;
393- POM . popup . setInputValue ( 'endDateTimeZoneEditor' , 'America/Anchorage' ) ;
394- POM . popup . saveButton . click ( ) ;
395-
396- scheduler . showAppointmentPopup ( ) ;
397-
398- expect ( POM . popup . getInputValue ( 'subjectEditor' ) ) . toBe ( '' ) ;
399- expect ( POM . popup . getInputValue ( 'descriptionEditor' ) ) . toBe ( '' ) ;
400- expect ( POM . popup . getInputValue ( 'startDateTimeZoneEditor' ) ) . toBe ( '' ) ;
401- expect ( POM . popup . getInputValue ( 'endDateTimeZoneEditor' ) ) . toBe ( '' ) ;
402- } ) ;
403-
404- it ( 'should have correct form data when opening second appointment' , async ( ) => {
380+ it ( 'should create a new form instance on each popup opening' , async ( ) => {
405381 const { scheduler, POM } = await createScheduler ( getDefaultConfig ( ) ) ;
406382
407383 scheduler . showAppointmentPopup ( commonAppointment ) ;
408-
409- expect ( POM . popup . dxForm . option ( 'formData' ) ) . toMatchObject ( { ...commonAppointment } ) ;
384+ const firstFormInstance = POM . popup . dxForm ;
410385
411386 POM . popup . cancelButton . click ( ) ;
412387
413- scheduler . showAppointmentPopup ( allDayAppointment ) ;
414-
415- expect ( POM . popup . dxForm . option ( 'formData' ) ) . toMatchObject ( { ...allDayAppointment } ) ;
416- } ) ;
417-
418- it ( 'should have empty resource editor value when opening second appointment' , async ( ) => {
419- const { scheduler, POM } = await createScheduler ( {
420- ...getDefaultConfig ( ) ,
421- resources : [ {
422- fieldExpr : 'roomId' ,
423- dataSource : [
424- { text : 'Room 1' , id : 1 , color : '#00af2c' } ,
425- { text : 'Room 2' , id : 2 , color : '#56ca85' } ,
426- { text : 'Room 3' , id : 3 , color : '#8ecd3c' } ,
427- ] ,
428- } ] ,
429- } ) ;
430-
431- scheduler . showAppointmentPopup ( {
432- text : 'Resource test app' ,
433- startDate : new Date ( 2017 , 4 , 9 , 9 , 30 ) ,
434- endDate : new Date ( 2017 , 4 , 9 , 11 ) ,
435- roomId : 1 ,
436- } ) ;
437- POM . popup . setInputValue ( 'roomId' , 2 ) ;
438- scheduler . hideAppointmentPopup ( true ) ;
439-
440- scheduler . showAppointmentPopup ( ) ;
441- expect ( POM . popup . getInputValue ( 'roomId' ) ) . toBe ( '' ) ;
442- } ) ;
443-
444- it ( 'should have correct repeat editor value when opening recurring appointment after common appointment' , async ( ) => {
445- const { scheduler, POM } = await createScheduler ( getDefaultConfig ( ) ) ;
446-
447- scheduler . showAppointmentPopup ( { ...commonAppointment } ) ;
448- POM . popup . saveButton . click ( ) ;
388+ scheduler . showAppointmentPopup ( commonAppointment ) ;
389+ const secondFormInstance = POM . popup . dxForm ;
449390
450- scheduler . showAppointmentPopup ( { ...recurringAppointment } ) ;
451- POM . popup . editSeriesButton . click ( ) ;
452- expect ( POM . popup . getInputValue ( 'repeatEditor' ) ) . toBe ( 'Daily' ) ;
391+ expect ( secondFormInstance ) . not . toBe ( firstFormInstance ) ;
453392 } ) ;
454393
455394 it ( 'should have correct editor values when opening for empty date cell - 1' , async ( ) => {
@@ -939,36 +878,6 @@ describe('Appointment Form', () => {
939878 expect ( POM . popup . getInputValue ( 'endDateEditor' ) ) . toBe ( '5/1/2017' ) ;
940879 expect ( POM . popup . isInputVisible ( 'endTimeEditor' ) ) . toBeFalsy ( ) ;
941880 } ) ;
942-
943- it ( 'should show correct dates after switching off allDay and canceling changes (T832711)' , async ( ) => {
944- const { scheduler, POM } = await createScheduler ( undefined ) ;
945-
946- scheduler . showAppointmentPopup ( allDayAppointment ) ;
947- POM . popup . getInput ( 'allDayEditor' ) . click ( ) ;
948- POM . popup . cancelButton . click ( ) ;
949-
950- scheduler . showAppointmentPopup ( allDayAppointment ) ;
951-
952- expect ( POM . popup . getInputValue ( 'startDateEditor' ) ) . toBe ( '5/1/2017' ) ;
953- expect ( POM . popup . isInputVisible ( 'startTimeEditor' ) ) . toBeFalsy ( ) ;
954- expect ( POM . popup . getInputValue ( 'endDateEditor' ) ) . toBe ( '5/1/2017' ) ;
955- expect ( POM . popup . isInputVisible ( 'endTimeEditor' ) ) . toBeFalsy ( ) ;
956- } ) ;
957-
958- it ( 'should show correct dates after switching on allDay and canceling changes (T832711)' , async ( ) => {
959- const { scheduler, POM } = await createScheduler ( getDefaultConfig ( ) ) ;
960-
961- scheduler . showAppointmentPopup ( commonAppointment ) ;
962- POM . popup . getInput ( 'allDayEditor' ) . click ( ) ;
963- POM . popup . cancelButton . click ( ) ;
964-
965- scheduler . showAppointmentPopup ( commonAppointment ) ;
966-
967- expect ( POM . popup . getInputValue ( 'startDateEditor' ) ) . toBe ( '5/9/2017' ) ;
968- expect ( POM . popup . getInputValue ( 'startTimeEditor' ) ) . toBe ( '9:30 AM' ) ;
969- expect ( POM . popup . getInputValue ( 'endDateEditor' ) ) . toBe ( '5/9/2017' ) ;
970- expect ( POM . popup . getInputValue ( 'endTimeEditor' ) ) . toBe ( '11:00 AM' ) ;
971- } ) ;
972881 } ) ;
973882
974883 describe ( 'Timezone Editors' , ( ) => {
@@ -1527,45 +1436,6 @@ describe('Appointment Form', () => {
15271436 expect ( POM . popup . getInputValue ( 'recurrenceRepeatEndEditor' ) ) . toBe ( 'count' ) ;
15281437 expect ( POM . popup . getInputValue ( 'recurrenceEndCountEditor' ) ) . toBe ( '10 occurrence(s)' ) ;
15291438 } ) ;
1530-
1531- it ( 'should have correct input values when opening second weekly recurring appointment' , async ( ) => {
1532- const { scheduler, POM } = await createScheduler ( getDefaultConfig ( ) ) ;
1533-
1534- const appointment1 = {
1535- text : 'Meeting' ,
1536- startDate : new Date ( 2017 , 4 , 1 , 10 , 30 ) ,
1537- endDate : new Date ( 2017 , 4 , 1 , 11 ) ,
1538- recurrenceRule : 'FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,FR;COUNT=5' ,
1539- repeatEnd : 'count' ,
1540- } ;
1541- const appointment2 = {
1542- text : 'Meeting' ,
1543- startDate : new Date ( 2017 , 4 , 2 , 10 , 30 ) ,
1544- endDate : new Date ( 2017 , 4 , 2 , 11 ) ,
1545- recurrenceRule : 'FREQ=WEEKLY;INTERVAL=1;BYDAY=TU,TH;COUNT=5' ,
1546- repeatEnd : 'count' ,
1547- } ;
1548-
1549- scheduler . showAppointmentPopup ( appointment1 ) ;
1550- POM . popup . editSeriesButton . click ( ) ;
1551- POM . popup . recurrenceSettingsButton . click ( ) ;
1552-
1553- scheduler . hideAppointmentPopup ( ) ;
1554-
1555- scheduler . showAppointmentPopup ( appointment2 ) ;
1556- POM . popup . editSeriesButton . click ( ) ;
1557- POM . popup . recurrenceSettingsButton . click ( ) ;
1558-
1559- expect ( POM . popup . getInputValue ( 'repeatEditor' ) ) . toBe ( 'Weekly' ) ;
1560- expect ( POM . popup . getInputValue ( 'recurrenceStartDateEditor' ) ) . toBe ( '5/2/2017' ) ;
1561- expect ( POM . popup . getInputValue ( 'recurrenceCountEditor' ) ) . toBe ( '1' ) ;
1562- expect ( POM . popup . getInputValue ( 'recurrencePeriodEditor' ) ) . toBe ( 'Week(s)' ) ;
1563-
1564- const expectedWeekDaysSelection = [ false , true , false , true , false , false , false ] ;
1565- expect ( POM . popup . getWeekDaysSelection ( ) ) . toEqual ( expectedWeekDaysSelection ) ;
1566-
1567- expect ( POM . popup . getInputValue ( 'recurrenceEndCountEditor' ) ) . toBe ( '5 occurrence(s)' ) ;
1568- } ) ;
15691439 } ) ;
15701440
15711441 describe ( 'Repeat End Values Preservation' , ( ) => {
0 commit comments