@@ -844,21 +844,40 @@ async function expectTextToSpeechV2FullscreenShell(page) {
844844 const left = document . querySelector ( ".tool-shell-common__fullscreen-panel-left" ) . getBoundingClientRect ( ) ;
845845 const center = document . querySelector ( ".tool-shell-common__fullscreen-center-panel" ) . getBoundingClientRect ( ) ;
846846 const right = document . querySelector ( ".tool-shell-common__fullscreen-panel-right" ) . getBoundingClientRect ( ) ;
847+ const textContent = document . querySelector ( "#text2speach-V2TextContent" ) . getBoundingClientRect ( ) ;
848+ const queueContent = document . querySelector ( "#text2speach-V2QueueContent" ) . getBoundingClientRect ( ) ;
849+ const summaryAccordion = document . querySelector ( ".text2speach-V2__summary-accordion" ) . getBoundingClientRect ( ) ;
850+ const statusAccordion = document . querySelector ( ".text2speach-V2__status-accordion" ) . getBoundingClientRect ( ) ;
851+ const statusLog = document . querySelector ( "#text2speach-V2StatusLog" ) . getBoundingClientRect ( ) ;
847852 const rootStyle = getComputedStyle ( document . querySelector ( ".tool-shell-common__fullscreen-root" ) ) ;
848853 const gap = Number . parseFloat ( rootStyle . columnGap || "0" ) ;
849854 const horizontalPadding = Number . parseFloat ( rootStyle . paddingLeft || "0" ) + Number . parseFloat ( rootStyle . paddingRight || "0" ) ;
855+ const statusStyle = getComputedStyle ( document . querySelector ( "#text2speach-V2StatusLog" ) ) ;
850856 return {
851857 centerAfterLeft : center . left > left . right ,
852858 centerFillsRemaining : Math . abs ( center . width - ( root . width - horizontalPadding - left . width - right . width - ( gap * 2 ) ) ) <= 4 ,
859+ centerFitsViewport : center . bottom <= window . innerHeight + 1 ,
853860 centerWidth : Math . round ( center . width ) ,
854861 gridTemplateColumns : rootStyle . gridTemplateColumns ,
855862 leftAtSide : left . left < center . left ,
863+ leftFitsViewport : left . bottom <= window . innerHeight + 1 ,
856864 leftWidth : Math . round ( left . width ) ,
857865 layoutDisplay : rootStyle . display ,
866+ queueContentBottomWithinCenter : queueContent . bottom <= center . bottom + 1 ,
867+ queueContentHeight : Math . round ( queueContent . height ) ,
858868 rightAtSide : right . left > center . right ,
869+ rightFitsViewport : right . bottom <= window . innerHeight + 1 ,
859870 rightWithinRoot : right . right <= root . right + 1 ,
860871 rightWidth : Math . round ( right . width ) ,
861872 rootWidth : Math . round ( root . width ) ,
873+ statusBelowSummary : statusAccordion . top >= summaryAccordion . bottom - 1 ,
874+ statusBottomWithinRight : statusAccordion . bottom <= right . bottom + 1 ,
875+ statusLogHeight : Math . round ( statusLog . height ) ,
876+ statusLogOverflowY : statusStyle . overflowY ,
877+ summaryBottomWithinRight : summaryAccordion . bottom <= right . bottom + 1 ,
878+ textContentBottomWithinCenter : textContent . bottom <= center . bottom + 1 ,
879+ textContentHeight : Math . round ( textContent . height ) ,
880+ textContentVisible : textContent . height >= 220 ,
862881 viewportWidth : window . innerWidth
863882 } ;
864883 } ) ;
@@ -870,10 +889,22 @@ async function expectTextToSpeechV2FullscreenShell(page) {
870889 expect ( fullscreenLayout . rightWidth ) . toBe ( 360 ) ;
871890 expect ( fullscreenLayout . leftAtSide ) . toBe ( true ) ;
872891 expect ( fullscreenLayout . centerAfterLeft ) . toBe ( true ) ;
892+ expect ( fullscreenLayout . leftFitsViewport ) . toBe ( true ) ;
893+ expect ( fullscreenLayout . centerFitsViewport ) . toBe ( true ) ;
894+ expect ( fullscreenLayout . rightFitsViewport ) . toBe ( true ) ;
873895 expect ( fullscreenLayout . rightAtSide ) . toBe ( true ) ;
874896 expect ( fullscreenLayout . rightWithinRoot ) . toBe ( true ) ;
875897 expect ( fullscreenLayout . centerFillsRemaining ) . toBe ( true ) ;
876898 expect ( fullscreenLayout . centerWidth ) . toBeGreaterThan ( 500 ) ;
899+ expect ( fullscreenLayout . textContentVisible ) . toBe ( true ) ;
900+ expect ( fullscreenLayout . textContentBottomWithinCenter ) . toBe ( true ) ;
901+ expect ( fullscreenLayout . queueContentHeight ) . toBeGreaterThan ( 120 ) ;
902+ expect ( fullscreenLayout . queueContentBottomWithinCenter ) . toBe ( true ) ;
903+ expect ( fullscreenLayout . summaryBottomWithinRight ) . toBe ( true ) ;
904+ expect ( fullscreenLayout . statusBelowSummary ) . toBe ( true ) ;
905+ expect ( fullscreenLayout . statusBottomWithinRight ) . toBe ( true ) ;
906+ expect ( fullscreenLayout . statusLogHeight ) . toBeGreaterThan ( 120 ) ;
907+ expect ( fullscreenLayout . statusLogOverflowY ) . toBe ( "auto" ) ;
877908
878909 const namedSentencesHeader = page . locator ( '[aria-controls="text2speach-V2QueueContent"]' ) ;
879910 await namedSentencesHeader . click ( ) ;
@@ -1174,20 +1205,26 @@ test.describe("Workspace Manager V2 bootstrap", () => {
11741205 const actions = content . querySelector ( "#text2speach-V2SpeechActions" ) ;
11751206 const contentRect = content . getBoundingClientRect ( ) ;
11761207 const textareaRect = textarea . getBoundingClientRect ( ) ;
1208+ const fieldRect = textarea . closest ( ".text2speach-V2__field" ) . getBoundingClientRect ( ) ;
11771209 const actionsRect = actions . getBoundingClientRect ( ) ;
11781210 const contentStyle = getComputedStyle ( content ) ;
1211+ const rowGap = Number . parseFloat ( contentStyle . rowGap || contentStyle . gap || "0" ) ;
1212+ const paddingTop = Number . parseFloat ( contentStyle . paddingTop || "0" ) ;
1213+ const paddingBottom = Number . parseFloat ( contentStyle . paddingBottom || "0" ) ;
1214+ const expectedContentHeight = fieldRect . height + actionsRect . height + rowGap + paddingTop + paddingBottom ;
11791215 return {
11801216 actionsAreBottomControl : content . lastElementChild ?. id === "text2speach-V2SpeechActions" ,
11811217 actionsBelowText : actionsRect . top >= textareaRect . bottom ,
11821218 actionsBottomAligned : Math . abs ( actionsRect . bottom - contentRect . bottom ) <= 1 ,
1219+ contentExcessHeight : Math . round ( contentRect . height - expectedContentHeight ) ,
11831220 contentDisplay : contentStyle . display ,
11841221 contentFlexDirection : contentStyle . flexDirection ,
11851222 contentJustify : contentStyle . justifyContent ,
11861223 fieldMarginBottom : getComputedStyle ( textarea . closest ( ".text2speach-V2__field" ) ) . marginBottom ,
11871224 textareaResize : getComputedStyle ( textarea ) . resize
11881225 } ;
11891226 } ) ;
1190- expect ( textAccordionLayout ) . toEqual ( {
1227+ expect ( textAccordionLayout ) . toMatchObject ( {
11911228 actionsAreBottomControl : true ,
11921229 actionsBelowText : true ,
11931230 actionsBottomAligned : true ,
@@ -1197,11 +1234,27 @@ test.describe("Workspace Manager V2 bootstrap", () => {
11971234 fieldMarginBottom : "0px" ,
11981235 textareaResize : "none"
11991236 } ) ;
1237+ expect ( textAccordionLayout . contentExcessHeight ) . toBeLessThanOrEqual ( 16 ) ;
1238+ expect ( textAccordionLayout . contentExcessHeight ) . toBeGreaterThanOrEqual ( - 2 ) ;
12001239 const namedSentenceTopControls = await page . locator ( "#text2speach-V2QueueContent" ) . evaluate ( ( content ) => {
12011240 const firstElement = Array . from ( content . children ) . find ( ( child ) => child . nodeType === Node . ELEMENT_NODE ) ;
12021241 return firstElement ?. id || "" ;
12031242 } ) ;
12041243 expect ( namedSentenceTopControls ) . toBe ( "text2speach-V2QueueTiles" ) ;
1244+ const namedSentenceLayout = await page . locator ( "#text2speach-V2QueueContent" ) . evaluate ( ( content ) => {
1245+ const tiles = content . querySelector ( "#text2speach-V2QueueTiles" ) ;
1246+ const contentRect = content . getBoundingClientRect ( ) ;
1247+ const tilesRect = tiles . getBoundingClientRect ( ) ;
1248+ const contentStyle = getComputedStyle ( content ) ;
1249+ const paddingTop = Number . parseFloat ( contentStyle . paddingTop || "0" ) ;
1250+ const paddingBottom = Number . parseFloat ( contentStyle . paddingBottom || "0" ) ;
1251+ return {
1252+ contentExcessHeight : Math . round ( contentRect . height - tilesRect . height - paddingTop - paddingBottom ) ,
1253+ unusedBottomSpace : Math . round ( contentRect . bottom - tilesRect . bottom - paddingBottom )
1254+ } ;
1255+ } ) ;
1256+ expect ( namedSentenceLayout . contentExcessHeight ) . toBeLessThanOrEqual ( 16 ) ;
1257+ expect ( namedSentenceLayout . unusedBottomSpace ) . toBeLessThanOrEqual ( 2 ) ;
12051258 expect ( await page . locator ( "#text2speach-V2SpeechOptionsContent .text2speach-V2__item-actions button" ) . evaluateAll ( ( buttons ) => buttons . map ( ( button ) => button . textContent . trim ( ) ) ) ) . toEqual ( [ "Add" , "Duplicate" , "Delete" ] ) ;
12061259 const statusHeaderOrder = await page . locator ( ".text2speach-V2__status-accordion-header" ) . evaluate ( ( header ) => Array . from ( header . querySelectorAll ( ":scope > span, :scope > div > span, :scope > div > button" ) , ( element ) => element . textContent . trim ( ) ) ) ;
12071260 expect ( statusHeaderOrder ) . toEqual ( [ "Status" , "+" , "Clear" ] ) ;
0 commit comments