@@ -650,85 +650,6 @@ export const runOverlayTriggerTests = (type: string): void => {
650650 'hover content is not available at point'
651651 ) . to . be . false ;
652652 } ) ;
653-
654- it ( 'blocks body scroll when modal overlay is opened and restores when closed' , async function ( ) {
655- const originalBodyOverflow = document . body . style . overflow ;
656-
657- const modalTrigger = this . outerTrigger ;
658- modalTrigger . type = 'modal' ;
659- await elementUpdated ( modalTrigger ) ;
660-
661- // Open modal overlay
662- const opened = oneEvent ( modalTrigger , 'sp-opened' ) ;
663- this . outerButton . click ( ) ;
664- await opened ;
665-
666- // Check that body scroll is blocked
667- expect ( document . body . style . overflow ) . to . equal ( 'hidden' ) ;
668-
669- // Close modal overlay
670- const closed = oneEvent ( modalTrigger , 'sp-closed' ) ;
671- sendMouse ( {
672- steps : [
673- {
674- type : 'click' ,
675- position : [ 1 , 1 ] ,
676- } ,
677- ] ,
678- } ) ;
679- await closed ;
680-
681- // Check that body scroll is restored
682- expect ( document . body . style . overflow ) . to . equal (
683- originalBodyOverflow
684- ) ;
685- } ) ;
686-
687- it ( 'actually prevents page scrolling when modal overlay is open and restores scrolling when closed' , async function ( ) {
688- // Create a long enough page to enable scrolling
689- const longContent = document . createElement ( 'div' ) ;
690- longContent . style . height = '200vh' ; // Make page twice viewport height
691- longContent . style . width = '100%' ;
692- longContent . style . backgroundColor = 'transparent' ;
693- document . body . appendChild ( longContent ) ;
694-
695- const modalTrigger = this . outerTrigger ;
696- modalTrigger . type = 'modal' ;
697- await elementUpdated ( modalTrigger ) ;
698-
699- // Open modal overlay
700- const opened = oneEvent ( modalTrigger , 'sp-opened' ) ;
701- this . outerButton . click ( ) ;
702- await opened ;
703-
704- // Attempt to scroll while modal is open
705- const scrollYBeforeScroll = window . scrollY ;
706- window . scrollTo ( 0 , 100 ) ;
707- await nextFrame ( ) ;
708-
709- // Verify that scrolling was prevented
710- expect ( window . scrollY ) . to . equal ( scrollYBeforeScroll ) ;
711-
712- // Close modal overlay
713- const closed = oneEvent ( modalTrigger , 'sp-closed' ) ;
714- await sendMouse ( {
715- steps : [
716- {
717- type : 'click' ,
718- position : [ 1 , 1 ] ,
719- } ,
720- ] ,
721- } ) ;
722- await closed ;
723-
724- // Verify scrolling works again after modal is closed
725- window . scrollTo ( 0 , 100 ) ;
726- await nextFrame ( ) ;
727- expect ( window . scrollY ) . to . equal ( 100 ) ;
728-
729- // Clean up
730- document . body . removeChild ( longContent ) ;
731- } ) ;
732653 } ) ;
733654 describe ( 'System interactions' , ( ) => {
734655 afterEach ( async ( ) => {
0 commit comments