@@ -38,15 +38,33 @@ it('Should not jump to last target', () => {
3838 . should ( 'not.have.class' , 'active' ) ;
3939} ) ;
4040
41- it ( 'Should set active clicked links without scroll interferences' , ( ) => {
42- const targetsLength = 20 ;
41+ it ( 'Should jump to first target' , ( ) => {
42+ cy . mount ( App , {
43+ props : {
44+ jumpToFirst : true ,
45+ marginTop : 300 ,
46+ } ,
47+ } ) ;
4348
49+ cy . get ( 'a' ) . eq ( 0 ) . should ( 'have.class' , 'active' ) ;
50+ } ) ;
51+
52+ it ( 'Should not jump to first target' , ( ) => {
4453 cy . mount ( App , {
4554 props : {
46- targetsLength,
55+ jumpToFirst : false ,
56+ marginTop : 300 ,
4757 } ,
4858 } ) ;
4959
60+ cy . get ( 'a' ) . eq ( 0 ) . should ( 'not.have.class' , 'active' ) ;
61+ } ) ;
62+
63+ it ( 'Should set active clicked links without scroll interferences' , ( ) => {
64+ const targetsLength = 20 ;
65+
66+ cy . mount ( App ) ;
67+
5068 const randomIndices = getRandomSequence ( targetsLength ) ;
5169
5270 randomIndices . forEach ( ( index ) => {
@@ -57,12 +75,9 @@ it('Should set active clicked links without scroll interferences', () => {
5775} ) ;
5876
5977it ( 'Should update targets on cancel while scrolling from click' , ( ) => {
60- const targetsLength = 20 ;
61-
6278 cy . mount ( App , {
6379 props : {
6480 jumpToLast : true ,
65- targetsLength,
6681 } ,
6782 } ) ;
6883
@@ -78,9 +93,3 @@ it('Should update targets on cancel while scrolling from click', () => {
7893 cy . wait ( 1000 ) ;
7994 }
8095} ) ;
81-
82- /* it('Should jump to first target', () => {});
83-
84- it('Should jump to last target', () => {});
85-
86- it('Should toggle functionalities below minWidth', () => {}); */
0 commit comments