@@ -1936,17 +1936,30 @@ async function exerciseTabletLandscapeMobileParity(page, queryApiStub) {
19361936 await page . locator ( '[data-mobile-table-action="fields-panel"]' ) . click ( ) ;
19371937 await page . waitForFunction ( ( ) => document . body . classList . contains ( 'mobile-filter-panel-open' ) , null , { timeout : 5000 } ) ;
19381938 await expectElementWithinViewport ( page , '#filter-side-panel' , 'Tablet landscape display and filters sheet' ) ;
1939- await expectOverlayConsumesScroll ( page , '#filter-panel-body' , 'Tablet landscape display and filters sheet' ) ;
1939+ await expectOverlayConsumesScroll ( page , '#filter-panel-body .fp-display-section ' , 'Tablet landscape display and filters sheet' ) ;
19401940 await expectNoHorizontalOverflow ( page , 'Tablet landscape display and filters sheet' ) ;
19411941 const filterSheetMetrics = await page . locator ( '#filter-side-panel' ) . evaluate ( element => {
19421942 const rect = element . getBoundingClientRect ( ) ;
1943- const bodyRect = document . querySelector ( '#filter-panel-body' ) ?. getBoundingClientRect ( ) ;
1943+ const body = document . querySelector ( '#filter-panel-body' ) ;
1944+ const bodyRect = body ?. getBoundingClientRect ( ) ;
1945+ const bodyStyle = body ? window . getComputedStyle ( body ) : null ;
1946+ const sections = Array . from ( body ?. querySelectorAll ( '.fp-section' ) || [ ] ) . map ( section => {
1947+ const sectionRect = section . getBoundingClientRect ( ) ;
1948+ return {
1949+ height : sectionRect . height ,
1950+ overflowY : window . getComputedStyle ( section ) . overflowY ,
1951+ scrollHeight : section . scrollHeight
1952+ } ;
1953+ } ) ;
19441954 return {
19451955 bodyHeight : bodyRect ?. height || 0 ,
1956+ bodyColumns : bodyStyle ? bodyStyle . gridTemplateColumns . split ( ' ' ) . filter ( Boolean ) . length : 0 ,
19461957 bottomGap : Math . abs ( window . innerHeight - rect . bottom ) ,
19471958 left : rect . left ,
19481959 position : window . getComputedStyle ( element ) . position ,
19491960 right : rect . right ,
1961+ sectionCount : sections . length ,
1962+ sections,
19501963 top : rect . top ,
19511964 viewportHeight : window . innerHeight ,
19521965 viewportWidth : window . innerWidth
@@ -1959,6 +1972,9 @@ async function exerciseTabletLandscapeMobileParity(page, queryApiStub) {
19591972 || filterSheetMetrics . top < 48
19601973 || filterSheetMetrics . bottomGap > 24
19611974 || filterSheetMetrics . bodyHeight < filterSheetMetrics . viewportHeight * 0.46
1975+ || filterSheetMetrics . bodyColumns !== 2
1976+ || filterSheetMetrics . sectionCount < 2
1977+ || filterSheetMetrics . sections . some ( section => section . overflowY === 'visible' || section . height < filterSheetMetrics . bodyHeight * 0.82 )
19621978 ) {
19631979 throw new Error ( `Tablet landscape display and filters should remain a usable mobile sheet: ${ JSON . stringify ( filterSheetMetrics ) } ` ) ;
19641980 }
0 commit comments