@@ -34,6 +34,7 @@ import * as Persistence from "../platform/persistence.ts";
3434import { EnvironmentRpcUnavailableError } from "../rpc/client.ts" ;
3535import type { WsRpcProtocolClient } from "../rpc/protocol.ts" ;
3636import type { RpcSession } from "../rpc/session.ts" ;
37+ import { createGitEnvironmentAtoms } from "./git.ts" ;
3738
3839import {
3940 commitVcsRefsRefresh ,
@@ -316,6 +317,8 @@ describe("cached VCS refs", () => {
316317 const client = {
317318 [ WS_METHODS . vcsPull ] : ( ) => Effect . fail ( expectedError ) ,
318319 [ WS_METHODS . vcsRefreshStatus ] : ( ) => Effect . void ,
320+ [ WS_METHODS . gitPreparePullRequestThread ] : ( ) =>
321+ Effect . succeed ( { branch : "feature/pr" , worktreePath : null } ) ,
319322 } as unknown as WsRpcProtocolClient ;
320323 const supervisor = EnvironmentSupervisor . EnvironmentSupervisor . of ( {
321324 target : TARGET ,
@@ -371,6 +374,17 @@ describe("cached VCS refs", () => {
371374 expect ( AsyncResult . isSuccess ( refreshResult ) ) . toBe ( true ) ;
372375 expect ( yield * Ref . get ( clears ) ) . toBe ( 2 ) ;
373376 expect ( registry . get ( vcsRefsCacheStateAtom ( TARGET ) ) . revision ) . toBe ( 2 ) ;
377+
378+ const prepareResult = yield * Effect . promise ( ( ) =>
379+ createGitEnvironmentAtoms ( runtime ) . preparePullRequestThread . run ( registry , {
380+ environmentId : TARGET . environmentId ,
381+ input : { cwd : "/repo" , reference : "42" , mode : "local" } ,
382+ } ) ,
383+ ) ;
384+
385+ expect ( AsyncResult . isSuccess ( prepareResult ) ) . toBe ( true ) ;
386+ expect ( yield * Ref . get ( clears ) ) . toBe ( 3 ) ;
387+ expect ( registry . get ( vcsRefsCacheStateAtom ( TARGET ) ) . revision ) . toBe ( 3 ) ;
374388 } ) ,
375389 ) ,
376390 ) ;
0 commit comments