@@ -16,6 +16,7 @@ describe("ProjectRuntime", () => {
1616
1717 expect ( state . worktreeId ) . toBe ( "wt_search" ) ;
1818 expect ( state . branch ) . toBe ( "feature/search" ) ;
19+ expect ( state . label ) . toBeNull ( ) ;
1920 expect ( state . baseBranch ) . toBe ( "main" ) ;
2021 expect ( state . profile ) . toBe ( "default" ) ;
2122 expect ( state . agentName ) . toBe ( "claude" ) ;
@@ -109,4 +110,26 @@ describe("ProjectRuntime", () => {
109110 expect ( runtime . getWorktreeByBranch ( "feature/search" ) ) . toBeNull ( ) ;
110111 expect ( runtime . getWorktreeByBranch ( "feature/search-v2" ) ?. worktreeId ) . toBe ( "wt_search" ) ;
111112 } ) ;
113+
114+ it ( "updates label metadata without changing branch lookups" , ( ) => {
115+ const runtime = new ProjectRuntime ( ) ;
116+ runtime . upsertWorktree ( {
117+ worktreeId : "wt_search" ,
118+ branch : "feature/search" ,
119+ label : "Search UI" ,
120+ path : "/repo/__worktrees/feature-search" ,
121+ runtime : "host" ,
122+ } ) ;
123+
124+ const state = runtime . upsertWorktree ( {
125+ worktreeId : "wt_search" ,
126+ branch : "feature/search" ,
127+ label : "Search ranking" ,
128+ path : "/repo/__worktrees/feature-search" ,
129+ runtime : "host" ,
130+ } ) ;
131+
132+ expect ( state . label ) . toBe ( "Search ranking" ) ;
133+ expect ( runtime . getWorktreeByBranch ( "feature/search" ) ?. label ) . toBe ( "Search ranking" ) ;
134+ } ) ;
112135} ) ;
0 commit comments