@@ -26,21 +26,21 @@ describe('persistent timeline', () => {
2626 } ) ;
2727
2828 it ( 'persist the deletion of a column' , ( ) => {
29- const numberOfTimelineColumns = 9 ;
29+ cy . get ( DRAGGABLE_HEADER ) . then ( ( header ) => {
30+ const currentNumberOfTimelineColumns = header . length ;
31+ const expectedNumberOfTimelineColumns = currentNumberOfTimelineColumns - 1 ;
3032
31- cy . get ( DRAGGABLE_HEADER )
32- . eq ( TABLE_COLUMN_EVENTS_MESSAGE )
33- . invoke ( 'text' )
34- . should ( 'equal' , 'message' ) ;
33+ cy . wrap ( header ) . eq ( TABLE_COLUMN_EVENTS_MESSAGE ) . invoke ( 'text' ) . should ( 'equal' , 'message' ) ;
34+ removeColumn ( TABLE_COLUMN_EVENTS_MESSAGE ) ;
3535
36- cy . get ( DRAGGABLE_HEADER ) . should ( 'have.length' , numberOfTimelineColumns ) ;
36+ cy . get ( DRAGGABLE_HEADER ) . should ( 'have.length' , expectedNumberOfTimelineColumns ) ;
3737
38- removeColumn ( TABLE_COLUMN_EVENTS_MESSAGE ) ;
39- reload ( waitsForEventsToBeLoaded ) ;
38+ reload ( waitsForEventsToBeLoaded ) ;
4039
41- cy . get ( DRAGGABLE_HEADER ) . should ( 'have.length' , numberOfTimelineColumns - 1 ) ;
42- cy . get ( DRAGGABLE_HEADER ) . each ( ( $el ) => {
43- expect ( $el . text ( ) ) . not . equal ( 'message' ) ;
40+ cy . get ( DRAGGABLE_HEADER ) . should ( 'have.length' , expectedNumberOfTimelineColumns ) ;
41+ cy . get ( DRAGGABLE_HEADER ) . each ( ( $el ) => {
42+ expect ( $el . text ( ) ) . not . equal ( 'message' ) ;
43+ } ) ;
4444 } ) ;
4545 } ) ;
4646} ) ;
0 commit comments