@@ -1217,6 +1217,50 @@ test.describe("Workspace Manager V2 bootstrap", () => {
12171217 await expect ( page . locator ( "#text2speech-V2StopButton" ) ) . toBeDisabled ( ) ;
12181218 await expect ( page . locator ( "#text2speech-V2StatusLog" ) ) . toHaveValue ( / O K T e x t t o S p e e c h V 2 e m p t y l a u n c h : n o s a m p l e P r e s e t P a t h U R L J S O N s o u r c e , w o r k s p a c e p a y l o a d , o r i m p o r t e d J S O N i s l o a d e d \. U s e I m p o r t J S O N o r o p e n a s a m p l e J S O N s o u r c e t o l o a d n a m e d s p e e c h i t e m s \. / ) ;
12191219 await expect ( page . locator ( "#text2speech-V2StatusLog" ) ) . not . toHaveValue ( / T e x t t o S p e e c h V 2 d e f a u l t q u e u e | L o a d e d 3 s c h e m a - c o m p l e t e / ) ;
1220+ const statusLogLayout = await page . locator ( "#text2speech-V2StatusLogContent" ) . evaluate ( ( content ) => {
1221+ const log = content . querySelector ( "#text2speech-V2StatusLog" ) ;
1222+ const contentRect = content . getBoundingClientRect ( ) ;
1223+ const logRect = log . getBoundingClientRect ( ) ;
1224+ const contentStyle = getComputedStyle ( content ) ;
1225+ const logStyle = getComputedStyle ( log ) ;
1226+ const paddingBottom = Number . parseFloat ( contentStyle . paddingBottom || "0" ) ;
1227+ const paddingTop = Number . parseFloat ( contentStyle . paddingTop || "0" ) ;
1228+ const innerHeight = content . clientHeight - paddingTop - paddingBottom ;
1229+ return {
1230+ contentOverflowY : contentStyle . overflowY ,
1231+ logFlexGrow : logStyle . flexGrow ,
1232+ logHeight : Math . round ( logRect . height ) ,
1233+ logOverflowY : logStyle . overflowY ,
1234+ logResize : logStyle . resize ,
1235+ statusContentInnerHeight : Math . round ( innerHeight ) ,
1236+ unusedBottomSpace : Math . round ( contentRect . bottom - logRect . bottom - paddingBottom )
1237+ } ;
1238+ } ) ;
1239+ expect ( statusLogLayout ) . toMatchObject ( {
1240+ contentOverflowY : "hidden" ,
1241+ logFlexGrow : "1" ,
1242+ logOverflowY : "auto" ,
1243+ logResize : "none"
1244+ } ) ;
1245+ expect ( statusLogLayout . logHeight ) . toBeGreaterThanOrEqual ( statusLogLayout . statusContentInnerHeight - 2 ) ;
1246+ expect ( statusLogLayout . unusedBottomSpace ) . toBeLessThanOrEqual ( 2 ) ;
1247+ const statusLogScrollState = await page . locator ( "#text2speech-V2StatusLog" ) . evaluate ( ( log ) => {
1248+ const pageHadScrollbarBefore = document . documentElement . scrollHeight > document . documentElement . clientHeight ;
1249+ log . value = Array . from ( { length : 80 } , ( _ , index ) => `OK Status log overflow probe ${ index + 1 } ` ) . join ( "\n" ) ;
1250+ log . scrollTop = log . scrollHeight ;
1251+ return {
1252+ internalScrollHeight : log . scrollHeight ,
1253+ pageHasScrollbarAfter : document . documentElement . scrollHeight > document . documentElement . clientHeight ,
1254+ pageHadScrollbarBefore,
1255+ statusHasInternalScrollbar : log . scrollHeight > log . clientHeight ,
1256+ statusScrolledInternally : log . scrollTop > 0
1257+ } ;
1258+ } ) ;
1259+ expect ( statusLogScrollState . statusHasInternalScrollbar ) . toBe ( true ) ;
1260+ expect ( statusLogScrollState . statusScrolledInternally ) . toBe ( true ) ;
1261+ expect ( statusLogScrollState . pageHadScrollbarBefore ) . toBe ( false ) ;
1262+ expect ( statusLogScrollState . pageHasScrollbarAfter ) . toBe ( false ) ;
1263+ await page . locator ( "#text2speech-V2ClearStatusButton" ) . click ( ) ;
12201264 const emptySummary = JSON . parse ( await page . locator ( "#text2speech-V2SpeechSummary" ) . textContent ( ) ) ;
12211265 expect ( emptySummary ) . toEqual ( [ ] ) ;
12221266 await page . locator ( "#text2speech-V2AddItemButton" ) . click ( ) ;
0 commit comments