@@ -60,7 +60,7 @@ test('queue stays above the measured composer across phone, keyboard-height and
6060 const page = await browser . newPage ( ) ;
6161 for ( const [ width , height ] of [ [ 320 , 568 ] , [ 390 , 844 ] , [ 390 , 420 ] , [ 768 , 800 ] , [ 1200 , 900 ] ] ) {
6262 await page . setViewport ( { width, height} ) ;
63- await page . goto ( server . origin + '/tests/fixtures/host-queue.html?count=8' ) ;
63+ await page . goto ( server . origin + '/tests/fixtures/host-queue.html?count=8&theme=' + ( width === 768 ? 'light' : 'dark' ) ) ;
6464 await page . waitForSelector ( '.host-message-queue li' ) ;
6565 await page . waitForFunction ( ( ) => {
6666 const wrap = document . querySelector ( '.chat-page__input-wrap' ) ;
@@ -99,6 +99,21 @@ test('queue stays above the measured composer across phone, keyboard-height and
9999 await page . goto ( server . origin + '/tests/fixtures/host-queue.html?count=2&expanded=false' ) ;
100100 await page . waitForSelector ( '.host-message-queue li' ) ;
101101 assert . equal ( await page . $ ( '.chat-page__input' ) , null , 'queue controls also work alongside the collapsed composer' ) ;
102+ const geometry = await page . evaluate ( ( ) => {
103+ const box = s => document . querySelector ( s ) . getBoundingClientRect ( ) ;
104+ const composer = box ( '.chat-page__composer' ) , stop = box ( '.chat-page__send-btn.is-stop' ) ;
105+ const plus = box ( '.chat-page__composer-leading' ) ;
106+ const text = box ( '.chat-msg__assistant-content' ) ;
107+ const icon = box ( '.chat-thinking [data-openbitfun-part="leading"]' ) ;
108+ return { top :stop . top - composer . top , bottom :composer . bottom - stop . bottom , right :composer . right - stop . right ,
109+ left :plus . left - composer . left , width :stop . width , plusWidth :plus . width ,
110+ textLeft :text . left + parseFloat ( getComputedStyle ( document . querySelector ( '.chat-msg__assistant-content' ) ) . paddingLeft ) , iconLeft :icon . left } ;
111+ } ) ;
112+ assert . equal ( geometry . width , 44 ) ;
113+ assert . equal ( geometry . plusWidth , 44 ) ;
114+ for ( const edge of [ 'top' , 'bottom' , 'left' ] ) assert . ok ( Math . abs ( geometry [ edge ] - geometry . right ) < 1 , JSON . stringify ( geometry ) ) ;
115+ assert . ok ( Math . abs ( geometry . textLeft - geometry . iconLeft ) < 1 , JSON . stringify ( geometry ) ) ;
116+ await page . screenshot ( { path :'/tmp/mobile-queue-aligned.png' , fullPage :true } ) ;
102117 await page . click ( '[aria-label="排队消息说明"]' ) ;
103118 await page . waitForSelector ( '.host-message-queue__help' ) ;
104119 await page . click ( '[aria-label="排队消息说明"]' ) ;
0 commit comments