@@ -403,4 +403,80 @@ describe('Example 43 - colspan/rowspan - Employees Timesheets', { retries: 0 },
403403 cy . get ( '[data-row=6] > .slick-cell.l4.r4.active.editable .editor-text' ) . should ( 'not.exist' ) ;
404404 } ) ;
405405 } ) ;
406+
407+ describe ( 'Rowspan Remapping' , ( ) => {
408+ describe ( 'hide EmployeeID' , ( ) => {
409+ it ( 'should hide EmployeeID' , ( ) => {
410+ cy . get ( '[data-test="toggle-employee-id"]' ) . click ( ) ;
411+ } ) ;
412+
413+ it ( 'should expect EmployeeID to follow columns at index 0 column index' , ( ) => {
414+ cy . get ( `[data-row=0] > .slick-cell.l0.r0.rowspan` ) . should ( 'contain' , 'Davolio' ) ;
415+ cy . get ( `[data-row=0] > .slick-cell.l0.r0.rowspan` ) . should ( ( $el ) =>
416+ expect ( parseInt ( `${ $el . outerHeight ( ) } ` , 10 ) ) . to . eq ( GRID_ROW_HEIGHT * 2 )
417+ ) ;
418+
419+ cy . get ( `[data-row=2] > .slick-cell.l1.r3.rowspan` ) . should ( 'contain' , 'Check Mail' ) ;
420+ cy . get ( `[data-row=2] > .slick-cell.l1.r3.rowspan` ) . should ( ( $el ) =>
421+ expect ( parseInt ( `${ $el . outerHeight ( ) } ` , 10 ) ) . to . eq ( GRID_ROW_HEIGHT * 2 )
422+ ) ;
423+
424+ cy . get ( `[data-row=8] > .slick-cell.l6.r8.rowspan` ) . should ( 'contain' , 'Development' ) ;
425+ cy . get ( `[data-row=8] > .slick-cell.l6.r8.rowspan` ) . should ( ( $el ) =>
426+ expect ( parseInt ( `${ $el . outerHeight ( ) } ` , 10 ) ) . to . eq ( GRID_ROW_HEIGHT * 2 )
427+ ) ;
428+ } ) ;
429+
430+ it ( 'should expect "Lunch Break" to be moved to the left by 1 index less' , ( ) => {
431+ cy . get ( `[data-row=0] > .slick-cell.l9.r11.rowspan` ) . should ( 'contain' , 'Lunch Break' ) ;
432+ cy . get ( `[data-row=0] > .slick-cell.l9.r11.rowspan` ) . should ( ( $el ) =>
433+ expect ( parseInt ( `${ $el . outerHeight ( ) } ` , 10 ) ) . to . eq ( GRID_ROW_HEIGHT * 10 )
434+ ) ;
435+ } ) ;
436+
437+ it ( 'should expect "Development" to be moved to the left by 1 index less' , ( ) => {
438+ cy . get ( `[data-row=1] > .slick-cell.l12.r13.rowspan` ) . should ( 'contain' , 'Development' ) ;
439+ cy . get ( `[data-row=1] > .slick-cell.l12.r13.rowspan` ) . should ( ( $el ) =>
440+ expect ( parseInt ( `${ $el . outerHeight ( ) } ` , 10 ) ) . to . eq ( GRID_ROW_HEIGHT * 5 )
441+ ) ;
442+ } ) ;
443+ } ) ;
444+
445+ describe ( 'show EmployeeID' , ( ) => {
446+ it ( 'should show EmployeeID' , ( ) => {
447+ cy . get ( '[data-test="toggle-employee-id"]' ) . click ( ) ;
448+ } ) ;
449+
450+ it ( 'should expect EmployeeID to follow columns at index 1 column index' , ( ) => {
451+ cy . get ( `[data-row=0] > .slick-cell.l1.r1.rowspan` ) . should ( 'contain' , 'Davolio' ) ;
452+ cy . get ( `[data-row=0] > .slick-cell.l1.r1.rowspan` ) . should ( ( $el ) =>
453+ expect ( parseInt ( `${ $el . outerHeight ( ) } ` , 10 ) ) . to . eq ( GRID_ROW_HEIGHT * 2 )
454+ ) ;
455+
456+ cy . get ( `[data-row=2] > .slick-cell.l2.r4.rowspan` ) . should ( 'contain' , 'Check Mail' ) ;
457+ cy . get ( `[data-row=2] > .slick-cell.l2.r4.rowspan` ) . should ( ( $el ) =>
458+ expect ( parseInt ( `${ $el . outerHeight ( ) } ` , 10 ) ) . to . eq ( GRID_ROW_HEIGHT * 2 )
459+ ) ;
460+
461+ cy . get ( `[data-row=8] > .slick-cell.l7.r9.rowspan` ) . should ( 'contain' , 'Development' ) ;
462+ cy . get ( `[data-row=8] > .slick-cell.l7.r9.rowspan` ) . should ( ( $el ) =>
463+ expect ( parseInt ( `${ $el . outerHeight ( ) } ` , 10 ) ) . to . eq ( GRID_ROW_HEIGHT * 2 )
464+ ) ;
465+ } ) ;
466+
467+ it ( 'should expect "Lunch Break" to be moved to the right by 1 index less' , ( ) => {
468+ cy . get ( `[data-row=0] > .slick-cell.l10.r12.rowspan` ) . should ( 'contain' , 'Lunch Break' ) ;
469+ cy . get ( `[data-row=0] > .slick-cell.l10.r12.rowspan` ) . should ( ( $el ) =>
470+ expect ( parseInt ( `${ $el . outerHeight ( ) } ` , 10 ) ) . to . eq ( GRID_ROW_HEIGHT * 10 )
471+ ) ;
472+ } ) ;
473+
474+ it ( 'should expect "Development" to be moved to the right by 1 index less and a large "Development" section that spans over multiple columns & rows in the afternoon' , ( ) => {
475+ cy . get ( `[data-row=1] > .slick-cell.l13.r14.rowspan` ) . should ( 'contain' , 'Development' ) ;
476+ cy . get ( `[data-row=1] > .slick-cell.l13.r14.rowspan` ) . should ( ( $el ) =>
477+ expect ( parseInt ( `${ $el . outerHeight ( ) } ` , 10 ) ) . to . eq ( GRID_ROW_HEIGHT * 5 )
478+ ) ;
479+ } ) ;
480+ } ) ;
481+ } ) ;
406482} ) ;
0 commit comments