@@ -581,7 +581,24 @@ test.describe('issue 159 retained canonical capability behavior', () => {
581581 } ) ;
582582
583583 await page . setViewportSize ( { width : 390 , height : 844 } ) ;
584+ const sidebar = page . locator ( '#sidebar' ) ;
585+ const mobileMenuButton = page . locator ( '#mobile-menu-button' ) ;
586+ await mobileMenuButton . click ( ) ;
587+ await expect ( mobileMenuButton ) . toHaveAttribute ( 'aria-expanded' , 'true' ) ;
588+ await expect ( sidebar ) . toHaveAttribute ( 'role' , 'dialog' ) ;
589+ await page . locator ( '#sidebar-close-button' ) . click ( ) ;
590+ await expect ( mobileMenuButton ) . toHaveAttribute ( 'aria-expanded' , 'false' ) ;
591+ await expect ( sidebar ) . toHaveAttribute ( 'aria-hidden' , 'true' ) ;
592+ await expect ( sidebar ) . toHaveAttribute ( 'inert' , '' ) ;
593+ await expect ( page . locator ( '#sidebar-scrim' ) ) . toBeHidden ( ) ;
584594 await expect ( attentionRow ) . toBeVisible ( ) ;
595+ const mobileOverflow = await page . evaluate ( ( ) => ( {
596+ viewportWidth : document . documentElement . clientWidth ,
597+ documentScrollWidth : document . documentElement . scrollWidth ,
598+ bodyScrollWidth : document . body . scrollWidth ,
599+ } ) ) ;
600+ expect ( mobileOverflow . documentScrollWidth ) . toBeLessThanOrEqual ( mobileOverflow . viewportWidth ) ;
601+ expect ( mobileOverflow . bodyScrollWidth ) . toBeLessThanOrEqual ( mobileOverflow . viewportWidth ) ;
585602 await page . screenshot ( {
586603 path : path . join ( ISSUE_196_SCREENSHOTS , 'operator-day-new-york-mobile.png' ) ,
587604 fullPage : true ,
0 commit comments