@@ -3,20 +3,20 @@ import {
33 VIEWPORT_HEADER_HIDDEN as HIDDEN ,
44} from '../cypress/support/constants'
55
6- import { defaultOptions } from '../src/constants'
6+ import { TRANSITION_STYLES } from '../src/constants'
77
88const ITERATIONS = 10
99const FIXED = RELATIVE * 2
1010
1111describe ( 'Functionalies are disabled' , ( ) => {
1212 it ( 'Resizing from `position: fixed` to `position: relative`' , ( ) => {
13- cy . mountApp ( ) . resizeRoot ( FIXED )
13+ cy . mountApp ( )
1414
1515 for ( let i = 0 ; i < ITERATIONS ; i ++ ) {
16- cy . resizeRoot ( FIXED ) . wait ( 100 ) . resizeRoot ( RELATIVE ) . wait ( 100 )
16+ cy . resizeRoot ( FIXED ) . resizeRoot ( RELATIVE )
1717 }
1818
19- cy . getScrollSubject ( ) . scrollToHide ( )
19+ cy . scrollDown ( )
2020 cy . get ( 'header' )
2121 . invoke ( 'attr' , 'style' )
2222 . then ( ( style ) => {
@@ -28,10 +28,10 @@ describe('Functionalies are disabled', () => {
2828 cy . mountApp ( ) . resizeRoot ( HIDDEN )
2929
3030 for ( let i = 0 ; i < ITERATIONS ; i ++ ) {
31- cy . resizeRoot ( FIXED ) . wait ( 100 ) . resizeRoot ( HIDDEN ) . wait ( 100 )
31+ cy . resizeRoot ( FIXED ) . resizeRoot ( HIDDEN )
3232 }
3333
34- cy . getScrollSubject ( ) . scrollToHide ( )
34+ cy . scrollDown ( )
3535 cy . get ( 'header' )
3636 . invoke ( 'attr' , 'style' )
3737 . then ( ( style ) => {
@@ -42,24 +42,24 @@ describe('Functionalies are disabled', () => {
4242
4343describe ( 'Functionalies are enabled' , ( ) => {
4444 it ( 'Resizing from `position: relative` to `position: fixed`' , ( ) => {
45- cy . mountApp ( ) . resizeRoot ( RELATIVE )
45+ cy . mountApp ( )
4646
4747 for ( let i = 0 ; i < ITERATIONS ; i ++ ) {
48- cy . resizeRoot ( RELATIVE ) . wait ( 100 ) . resizeRoot ( FIXED ) . wait ( 100 )
48+ cy . resizeRoot ( RELATIVE ) . resizeRoot ( FIXED )
4949 }
5050
51- cy . getScrollSubject ( ) . scrollToHide ( )
52- cy . get ( 'header' ) . checkStyles ( defaultOptions . leaveStyles )
51+ cy . scrollDown ( )
52+ cy . get ( 'header' ) . should ( 'be.hidden' ) . checkStyles ( TRANSITION_STYLES . leaveStyles )
5353 } )
5454
5555 it ( 'Resizing from `display: none` to `position: fixed`' , ( ) => {
56- cy . mountApp ( ) . resizeRoot ( HIDDEN )
56+ cy . mountApp ( )
5757
5858 for ( let i = 0 ; i < ITERATIONS ; i ++ ) {
59- cy . resizeRoot ( HIDDEN ) . wait ( 100 ) . resizeRoot ( FIXED ) . wait ( 100 )
59+ cy . resizeRoot ( HIDDEN ) . resizeRoot ( FIXED )
6060 }
6161
62- cy . getScrollSubject ( ) . scrollToHide ( )
63- cy . get ( 'header' ) . checkStyles ( defaultOptions . leaveStyles )
62+ cy . scrollDown ( )
63+ cy . get ( 'header' ) . should ( 'be.hidden' ) . checkStyles ( TRANSITION_STYLES . leaveStyles )
6464 } )
6565} )
0 commit comments