@@ -900,35 +900,46 @@ test.describe("Workspace Manager V2 bootstrap", () => {
900900 const dirtyHeader = document . querySelector ( ".session-inspector-v2__dirty-accordion-header" ) ;
901901 const statusHeader = document . querySelector ( ".session-inspector-v2__status-accordion-header" ) ;
902902 const rightPanel = document . querySelector ( ".session-inspector-v2__panel--right" ) ;
903+ const statusOutput = document . querySelector ( "#statusLog" ) ;
904+ const jsonOutputStyle = getComputedStyle ( jsonOutput ) ;
905+ const dataOutputStyle = getComputedStyle ( dataOutput ) ;
903906 const jsonContentStyle = getComputedStyle ( jsonContent ) ;
904907 const dataContentStyle = getComputedStyle ( dataContent ) ;
905908 const rectFor = ( element ) => element . getBoundingClientRect ( ) ;
906909 const rightRect = rectFor ( rightPanel ) ;
907910 const dirtyHeaderRect = rectFor ( dirtyHeader ) ;
908911 const statusHeaderRect = rectFor ( statusHeader ) ;
912+ rightPanel . scrollTop = rightPanel . scrollHeight ;
913+ const scrolledDirtyHeaderRect = rectFor ( dirtyHeader ) ;
914+ const scrolledStatusHeaderRect = rectFor ( statusHeader ) ;
915+ const statusOutputHeight = Math . round ( rectFor ( statusOutput ) . height ) ;
909916 return {
910917 dataContentDoesNotOwnScrollbar : dataContentStyle . overflowY === "hidden" && dataContentStyle . overflowX === "hidden" ,
911- dataOutputScrollsHorizontally : dataOutput . scrollWidth > dataOutput . clientWidth + 1 ,
918+ dataOutputHasNoHorizontalScrollbar : dataOutput . scrollWidth <= dataOutput . clientWidth + 1 ,
912919 dataOutputScrollsVertically : dataOutput . scrollHeight > dataOutput . clientHeight + 1 ,
913- dataOutputHeightBounded : rectFor ( dataOutput ) . height <= 170 ,
914- dirtyHeaderReachable : dirtyHeaderRect . top >= rightRect . top && dirtyHeaderRect . bottom <= rightRect . bottom ,
920+ dataOutputHeightMatchesStatus : Math . abs ( Math . round ( rectFor ( dataOutput ) . height ) - statusOutputHeight ) <= 1 ,
921+ dataOutputWrapsLongLines : dataOutputStyle . whiteSpace === "pre-wrap" && dataOutputStyle . overflowWrap === "anywhere" ,
922+ dirtyHeaderReachable : dirtyHeaderRect . top >= rightRect . top || ( scrolledDirtyHeaderRect . top >= rightRect . top && scrolledDirtyHeaderRect . bottom <= rightRect . bottom ) ,
915923 jsonContentDoesNotOwnScrollbar : jsonContentStyle . overflowY === "hidden" && jsonContentStyle . overflowX === "hidden" ,
916- jsonOutputScrollsHorizontally : jsonOutput . scrollWidth > jsonOutput . clientWidth + 1 ,
924+ jsonOutputHasNoHorizontalScrollbar : jsonOutput . scrollWidth <= jsonOutput . clientWidth + 1 ,
917925 jsonOutputScrollsVertically : jsonOutput . scrollHeight > jsonOutput . clientHeight + 1 ,
918- jsonOutputHeightBounded : rectFor ( jsonOutput ) . height <= 170 ,
919- statusHeaderReachable : statusHeaderRect . top >= rightRect . top && statusHeaderRect . bottom <= rightRect . bottom
926+ jsonOutputHeightMatchesStatus : Math . abs ( Math . round ( rectFor ( jsonOutput ) . height ) - statusOutputHeight ) <= 1 ,
927+ jsonOutputWrapsLongLines : jsonOutputStyle . whiteSpace === "pre-wrap" && jsonOutputStyle . overflowWrap === "anywhere" ,
928+ statusHeaderReachable : statusHeaderRect . top >= rightRect . top || ( scrolledStatusHeaderRect . top >= rightRect . top && scrolledStatusHeaderRect . bottom <= rightRect . bottom )
920929 } ;
921930 } ) ;
922931 expect ( detailPanelState ) . toEqual ( {
923932 dataContentDoesNotOwnScrollbar : true ,
924- dataOutputScrollsHorizontally : true ,
933+ dataOutputHasNoHorizontalScrollbar : true ,
925934 dataOutputScrollsVertically : true ,
926- dataOutputHeightBounded : true ,
935+ dataOutputHeightMatchesStatus : true ,
936+ dataOutputWrapsLongLines : true ,
927937 dirtyHeaderReachable : true ,
928938 jsonContentDoesNotOwnScrollbar : true ,
929- jsonOutputScrollsHorizontally : true ,
939+ jsonOutputHasNoHorizontalScrollbar : true ,
930940 jsonOutputScrollsVertically : true ,
931- jsonOutputHeightBounded : true ,
941+ jsonOutputHeightMatchesStatus : true ,
942+ jsonOutputWrapsLongLines : true ,
932943 statusHeaderReachable : true
933944 } ) ;
934945 await page . locator ( "#copySessionInspectorV2AllButton" ) . click ( ) ;
@@ -949,20 +960,25 @@ test.describe("Workspace Manager V2 bootstrap", () => {
949960 const dirtyOutputScrollState = await page . evaluate ( ( ) => {
950961 const dirtyContent = document . querySelector ( "#sessionInspectorV2DirtyContent" ) ;
951962 const dirtyOutput = document . querySelector ( "#sessionInspectorV2DirtyOutput" ) ;
963+ const statusOutput = document . querySelector ( "#statusLog" ) ;
952964 const dirtyContentStyle = getComputedStyle ( dirtyContent ) ;
965+ const dirtyOutputStyle = getComputedStyle ( dirtyOutput ) ;
953966 const rect = dirtyOutput . getBoundingClientRect ( ) ;
967+ const statusOutputHeight = Math . round ( statusOutput . getBoundingClientRect ( ) . height ) ;
954968 return {
955969 dirtyContentDoesNotOwnScrollbar : dirtyContentStyle . overflowY === "hidden" && dirtyContentStyle . overflowX === "hidden" ,
956- dirtyOutputScrollsHorizontally : dirtyOutput . scrollWidth > dirtyOutput . clientWidth + 1 ,
970+ dirtyOutputHasNoHorizontalScrollbar : dirtyOutput . scrollWidth <= dirtyOutput . clientWidth + 1 ,
957971 dirtyOutputScrollsVertically : dirtyOutput . scrollHeight > dirtyOutput . clientHeight + 1 ,
958- dirtyOutputHeightBounded : rect . height <= 170
972+ dirtyOutputHeightMatchesStatus : Math . abs ( Math . round ( rect . height ) - statusOutputHeight ) <= 1 ,
973+ dirtyOutputWrapsLongLines : dirtyOutputStyle . whiteSpace === "pre-wrap" && dirtyOutputStyle . overflowWrap === "anywhere"
959974 } ;
960975 } ) ;
961976 expect ( dirtyOutputScrollState ) . toEqual ( {
962977 dirtyContentDoesNotOwnScrollbar : true ,
963- dirtyOutputScrollsHorizontally : true ,
978+ dirtyOutputHasNoHorizontalScrollbar : true ,
964979 dirtyOutputScrollsVertically : true ,
965- dirtyOutputHeightBounded : true
980+ dirtyOutputHeightMatchesStatus : true ,
981+ dirtyOutputWrapsLongLines : true
966982 } ) ;
967983 await page . locator ( '[data-session-inspector-v2-entry-id="sessionStorage:workspace.tools.no-data-test"]' ) . click ( ) ;
968984 await expect ( page . locator ( "#sessionInspectorV2DataOutput" ) ) . toContainText ( "No data section is present for sessionStorage:workspace.tools.no-data-test." ) ;
0 commit comments