@@ -22,6 +22,9 @@ describe('Example 19 - Draggable Grouping & Aggregators', { retries: 1 }, () =>
2222 cy . get ( '[data-test="group-duration-sort-value-btn"]' ) . click ( ) ;
2323 cy . get ( '[data-test="collapse-all-btn"]' ) . click ( ) ;
2424
25+ cy . get ( '.grouping-selects select:nth(0)' ) . should ( 'have.value' , '2: duration' ) ;
26+ cy . get ( '.grouping-selects select:nth(1)' ) . should ( 'not.have.value' ) ;
27+ cy . get ( '.grouping-selects select:nth(2)' ) . should ( 'not.have.value' ) ;
2528 cy . get ( `[style="top:${ GRID_ROW_HEIGHT * 0 } px"] > .slick-cell:nth(0) .slick-group-toggle.collapsed` ) . should ( 'have.length' , 1 ) ;
2629 cy . get ( `[style="top:${ GRID_ROW_HEIGHT * 0 } px"] > .slick-cell:nth(0) .slick-group-title` ) . should ( 'contain' , 'Duration: 0' ) ;
2730
@@ -45,6 +48,9 @@ describe('Example 19 - Draggable Grouping & Aggregators', { retries: 1 }, () =>
4548
4649 it ( 'should show 1 column title (Duration) shown in the pre-header section' , ( ) => {
4750 cy . get ( '.slick-dropped-grouping:nth(0) div' ) . contains ( 'Duration' ) ;
51+ cy . get ( '.grouping-selects select:nth(0)' ) . should ( 'have.value' , '2: duration' ) ;
52+ cy . get ( '.grouping-selects select:nth(1)' ) . should ( 'not.have.value' ) ;
53+ cy . get ( '.grouping-selects select:nth(2)' ) . should ( 'not.have.value' ) ;
4854 } ) ;
4955
5056 it ( 'should "Group by Duration then Effort-Driven" and expect 1st row to be expanded, 2nd row to be expanded and 3rd row to be a regular row' , ( ) => {
@@ -60,9 +66,12 @@ describe('Example 19 - Draggable Grouping & Aggregators', { retries: 1 }, () =>
6066 cy . get ( `[style="top:${ GRID_ROW_HEIGHT * 2 } px"] > .slick-cell:nth(1)` ) . should ( 'contain' , '0' ) ;
6167 } ) ;
6268
63- it ( 'should show 2 column titles (Duration, Effort-Driven) shown in the pre-header section' , ( ) => {
69+ it ( 'should show 2 column titles (Duration, Effort-Driven) shown in the pre-header section & same select dropdown ' , ( ) => {
6470 cy . get ( '.slick-dropped-grouping:nth(0) div' ) . contains ( 'Duration' ) ;
6571 cy . get ( '.slick-dropped-grouping:nth(1) div' ) . contains ( 'Effort-Driven' ) ;
72+ cy . get ( '.grouping-selects select:nth(0)' ) . should ( 'have.value' , '2: duration' ) ;
73+ cy . get ( '.grouping-selects select:nth(1)' ) . should ( 'have.value' , '7: effortDriven' ) ;
74+ cy . get ( '.grouping-selects select:nth(2)' ) . should ( 'not.have.value' ) ;
6675 } ) ;
6776
6877 it ( 'should be able to drag and swap grouped column titles inside the pre-header' , ( ) => {
@@ -72,6 +81,9 @@ describe('Example 19 - Draggable Grouping & Aggregators', { retries: 1 }, () =>
7281
7382 cy . get ( '.slick-dropped-grouping:nth(0) div' ) . contains ( 'Effort-Driven' ) ;
7483 cy . get ( '.slick-dropped-grouping:nth(1) div' ) . contains ( 'Duration' ) ;
84+ cy . get ( '.grouping-selects select:nth(0)' ) . should ( 'have.value' , '7: effortDriven' ) ;
85+ cy . get ( '.grouping-selects select:nth(1)' ) . should ( 'have.value' , '2: duration' ) ;
86+ cy . get ( '.grouping-selects select:nth(2)' ) . should ( 'not.have.value' ) ;
7587 } ) ;
7688
7789 it ( 'should expect the grouping to be swapped as well in the grid' , ( ) => {
@@ -179,5 +191,12 @@ describe('Example 19 - Draggable Grouping & Aggregators', { retries: 1 }, () =>
179191 cy . get ( '.right-footer' )
180192 . contains ( '500 of 500 items' ) ;
181193 } ) ;
194+
195+ it ( 'should clear all grouping and expect all select dropdown to be cleared too' , ( ) => {
196+ cy . get ( '[data-test="clear-grouping-btn"]' ) . click ( ) ;
197+ cy . get ( '.grouping-selects select:nth(0)' ) . should ( 'not.have.value' ) ;
198+ cy . get ( '.grouping-selects select:nth(1)' ) . should ( 'not.have.value' ) ;
199+ cy . get ( '.grouping-selects select:nth(2)' ) . should ( 'not.have.value' ) ;
200+ } ) ;
182201 } ) ;
183202} ) ;
0 commit comments