@@ -5,6 +5,8 @@ import { AsyncResult } from "effect/reactivity";
55import { expect , it , vi } from "vite-plus/test" ;
66import { page , userEvent } from "vite-plus/test/browser" ;
77
8+ import "~/index.css" ;
9+
810const state = vi . hoisted ( ( ) => ( {
911 projection : null as unknown ,
1012 commandSucceeds : false ,
@@ -295,18 +297,20 @@ it("shows a remote subagent's full title in its tooltip even when its environmen
295297 remoteChild : {
296298 environmentId : remoteEnvId ,
297299 threadId : remoteThreadId ,
298- label : "Remote VM" ,
300+ label : "Remote VM with a long machine name in the office " ,
299301 } ,
300302 } ,
301303 ] ,
302304 } ;
303305 await using screen = await render (
304- < ThreadRelationshipsPanel
305- environmentId = { environmentId }
306- threadId = { threadId }
307- showLineage
308- showSideChats = { false }
309- /> ,
306+ < div style = { { width : 320 } } >
307+ < ThreadRelationshipsPanel
308+ environmentId = { environmentId }
309+ threadId = { threadId }
310+ showLineage
311+ showSideChats = { false }
312+ />
313+ </ div > ,
310314 { router : "/environment/fork" } ,
311315 ) ;
312316
@@ -316,12 +320,16 @@ it("shows a remote subagent's full title in its tooltip even when its environmen
316320 . not . toBeInTheDocument ( ) ;
317321 await screen . getByRole ( "button" , { name : / P r e v i o u s a g e n t s / } ) . click ( ) ;
318322 const row = screen . getByRole ( "button" , { name : new RegExp ( longTitle ) } ) ;
323+ // A long environment label must not squeeze the title out of the row.
324+ expect (
325+ page . getByText ( longTitle , { exact : true } ) . element ( ) . getBoundingClientRect ( ) . width ,
326+ ) . toBeGreaterThan ( 0 ) ;
319327 await userEvent . hover ( row ) ;
320328 await vi . waitFor ( ( ) =>
321329 expect ( document . querySelector ( '[data-slot="tooltip-popup"]' ) ?. textContent ) . toContain ( longTitle ) ,
322330 ) ;
323331 expect ( document . querySelector ( '[data-slot="tooltip-popup"]' ) ?. textContent ) . toContain (
324- "Runs on Remote VM. Connect to it to open the thread there." ,
332+ "Runs on Remote VM with a long machine name in the office . Connect to it to open the thread there." ,
325333 ) ;
326334
327335 await row . click ( { force : true } ) ;
0 commit comments