@@ -303,16 +303,103 @@ test('chat becomes available after token connect', async ({ page }) => {
303303 await expect ( page . getByRole ( 'button' , { name : 'Chat' } ) ) . toBeVisible ( )
304304} )
305305
306- test ( 'workspace context status is visible only after PAT connect' , async ( { page } ) => {
306+ test ( 'workspace context status stays visible without PAT and after PAT connect' , async ( {
307+ page,
308+ } ) => {
307309 await waitForAppReady ( page )
308310
309311 const workspaceContextStatus = page . locator ( '#workspace-context-status' )
310- await expect ( workspaceContextStatus ) . toBeHidden ( )
312+ await expect ( workspaceContextStatus ) . toBeVisible ( )
313+ await expect ( workspaceContextStatus ) . toContainText ( 'local' )
311314
312315 await connectByotWithSingleRepo ( page )
313316 await expect ( workspaceContextStatus ) . toBeVisible ( )
314317} )
315318
319+ test ( 'Local workspace can be renamed from Workspaces drawer' , async ( { page } ) => {
320+ const sourceWorkspaceId = 'local_workspace_rename_source'
321+ const targetWorkspaceId = 'local_workspace_rename_target'
322+ const originalTitle = 'Local rename original title'
323+ const renamedTitle = 'Local rename updated title'
324+
325+ await waitForAppReady ( page )
326+
327+ await seedLocalWorkspaceContexts ( page , [
328+ {
329+ id : sourceWorkspaceId ,
330+ repo : '' ,
331+ workspaceScope : 'local' ,
332+ head : 'feat/local-rename-source' ,
333+ prTitle : originalTitle ,
334+ prContextState : 'inactive' ,
335+ tabs : [
336+ {
337+ id : 'component' ,
338+ path : 'src/component.tsx' ,
339+ language : 'tsx' ,
340+ role : 'component' ,
341+ content : 'export const App = () => <main>rename source</main>' ,
342+ order : 0 ,
343+ source : 'workspace' ,
344+ dirty : false ,
345+ } ,
346+ ] ,
347+ activeTabId : 'component' ,
348+ } ,
349+ {
350+ id : targetWorkspaceId ,
351+ repo : '' ,
352+ workspaceScope : 'local' ,
353+ head : 'feat/local-rename-target' ,
354+ prTitle : 'Local rename target title' ,
355+ prContextState : 'inactive' ,
356+ tabs : [
357+ {
358+ id : 'component' ,
359+ path : 'src/component.tsx' ,
360+ language : 'tsx' ,
361+ role : 'component' ,
362+ content : 'export const App = () => <main>rename target</main>' ,
363+ order : 0 ,
364+ source : 'workspace' ,
365+ dirty : false ,
366+ } ,
367+ ] ,
368+ activeTabId : 'component' ,
369+ } ,
370+ ] )
371+
372+ const workspacesToggle = page . getByRole ( 'button' , {
373+ name : 'Workspaces' ,
374+ exact : true ,
375+ } )
376+ await workspacesToggle . click ( )
377+
378+ const workspaceSelect = page . getByLabel ( 'Stored workspace' )
379+ const renameButton = page . getByRole ( 'button' , { name : 'Rename' , exact : true } )
380+
381+ await workspaceSelect . selectOption ( sourceWorkspaceId )
382+ await expect ( workspaceSelect ) . toHaveValue ( sourceWorkspaceId )
383+ await expect ( renameButton ) . toBeEnabled ( )
384+
385+ page . once ( 'dialog' , async dialog => {
386+ expect ( dialog . type ( ) ) . toBe ( 'prompt' )
387+ expect ( dialog . defaultValue ( ) ) . toBe ( originalTitle )
388+ await dialog . accept ( renamedTitle )
389+ } )
390+
391+ await renameButton . click ( )
392+ await expect ( page . locator ( '#workspaces-status' ) ) . toContainText ( 'Renamed workspace.' )
393+
394+ const records = await getAllWorkspaceRecords ( page )
395+ const renamedRecord = records . find ( record => record ?. id === sourceWorkspaceId )
396+
397+ expect ( renamedRecord ) . toBeTruthy ( )
398+ expect ( typeof renamedRecord ?. prTitle === 'string' ? renamedRecord . prTitle : '' ) . toBe (
399+ renamedTitle ,
400+ )
401+ } )
402+
316403test ( 'BYOT controls render with default app entry' , async ( { page } ) => {
317404 await waitForAppReady ( page , appEntryPath )
318405
0 commit comments