@@ -1890,7 +1890,7 @@ describe("mobile composer drafts", () => {
18901890 expect ( getComposerDraftSnapshot ( second ) . text ) . toBe ( "second idea" ) ;
18911891 } ) ;
18921892
1893- it ( "retargets a new-task draft to another project without losing its text " , ( ) => {
1893+ it ( "retargets a new-task draft to another project, keeping only a pull request workspace " , ( ) => {
18941894 const from = {
18951895 environmentId : EnvironmentId . make ( "environment-1" ) ,
18961896 projectId : ProjectId . make ( "project-1" ) ,
@@ -1921,35 +1921,20 @@ describe("mobile composer drafts", () => {
19211921 expect ( moved . project ) . toEqual ( { ...to , createdAt } ) ;
19221922 expect ( findNewTaskDraftKeys ( appAtomRegistry . get ( composerDraftsAtom ) , from ) ) . toEqual ( [ ] ) ;
19231923 expect ( findNewTaskDraftKeys ( appAtomRegistry . get ( composerDraftsAtom ) , to ) ) . toEqual ( [ key ] ) ;
1924- } ) ;
19251924
1926- it ( "keeps a pull request worktree selection when the draft moves between machines and back" , ( ) => {
1927- const from = {
1928- environmentId : EnvironmentId . make ( "environment-1" ) ,
1929- projectId : ProjectId . make ( "project-1" ) ,
1930- } ;
1931- const to = {
1932- environmentId : EnvironmentId . make ( "environment-2" ) ,
1933- projectId : ProjectId . make ( "project-2" ) ,
1934- } ;
19351925 const pullRequestSelection = {
19361926 mode : "worktree" as const ,
19371927 branch : "feature/pr-head" ,
19381928 worktreePath : null ,
19391929 startFromOrigin : false ,
19401930 pullRequestReference : "https://github.com/acme/repo/pull/42" ,
19411931 } ;
1942- const key = createNewTaskDraft ( from ) ;
1943- setComposerDraftText ( key , "Review this PR" ) ;
19441932 updateComposerDraftSettings ( key , { workspaceSelection : pullRequestSelection } ) ;
1945-
1946- retargetNewTaskDraft ( key , to , { keepPullRequestWorkspace : true } ) ;
1947- expect ( getComposerDraftSnapshot ( key ) . workspaceSelection ) . toEqual ( pullRequestSelection ) ;
1948-
19491933 retargetNewTaskDraft ( key , from , { keepPullRequestWorkspace : true } ) ;
19501934 expect ( getComposerDraftSnapshot ( key ) . workspaceSelection ) . toEqual ( pullRequestSelection ) ;
1951-
1952- retargetNewTaskDraft ( key , to ) ;
1935+ retargetNewTaskDraft ( key , to , { keepPullRequestWorkspace : true } ) ;
1936+ expect ( getComposerDraftSnapshot ( key ) . workspaceSelection ) . toEqual ( pullRequestSelection ) ;
1937+ retargetNewTaskDraft ( key , from ) ;
19531938 expect ( getComposerDraftSnapshot ( key ) . workspaceSelection ) . toBeUndefined ( ) ;
19541939 } ) ;
19551940
0 commit comments