@@ -167,14 +167,15 @@ describe('useIFrameBehavior hook', () => {
167167 ] ) ;
168168 } ) ;
169169 describe ( 'resize message' , ( ) => {
170- const customHeight = 23 ;
171- const resizeMessage = ( height = 23 ) => ( {
170+ const customHeight = 25 ;
171+ const defaultHeight = 23 ;
172+ const resizeMessage = ( height = defaultHeight ) => ( {
172173 data : { type : messageTypes . resize , payload : { height } } ,
173174 } ) ;
174175 const videoFullScreenMessage = ( open = false ) => ( {
175176 data : { type : messageTypes . videoFullScreen , payload : { open } } ,
176177 } ) ;
177- const testSetIFrameHeight = ( height = 23 ) => {
178+ const testSetIFrameHeight = ( height = defaultHeight ) => {
178179 const { cb } = useEventListener . mock . calls [ 0 ] [ 1 ] ;
179180 cb ( resizeMessage ( height ) ) ;
180181 expect ( setIframeHeight ) . toHaveBeenCalledWith ( height ) ;
@@ -187,6 +188,7 @@ describe('useIFrameBehavior hook', () => {
187188 cb ( resizeMessage ( customHeight ) ) ;
188189 expect ( setIframeHeight ) . toHaveBeenCalledWith ( 0 ) ;
189190 expect ( setIframeHeight ) . toHaveBeenCalledWith ( customHeight ) ;
191+ expect ( setIframeHeight ) . not . toHaveBeenCalledWith ( defaultHeight ) ;
190192 } ) ;
191193 } ) ;
192194 describe ( 'payload height is 0' , ( ) => {
@@ -197,6 +199,7 @@ describe('useIFrameBehavior hook', () => {
197199 cb ( resizeMessage ( 0 ) ) ;
198200 expect ( setIframeHeight ) . toHaveBeenCalledWith ( 0 ) ;
199201 expect ( setIframeHeight ) . not . toHaveBeenCalledWith ( customHeight ) ;
202+ expect ( setIframeHeight ) . not . toHaveBeenCalledWith ( defaultHeight ) ;
200203 } ) ;
201204 } ) ;
202205 describe ( 'payload is present but uninitialized' , ( ) => {
0 commit comments