@@ -8,28 +8,31 @@ describe("startup location", () => {
88 it ( "restores the exact last location" , async ( ) => {
99 vi . spyOn ( stateStorage , "getItem" ) . mockResolvedValue ( "/code" ) ;
1010 const client = {
11- getDesktopFileSystemChannels : vi . fn ( ) ,
12- createDesktopFileSystemChannel : vi . fn ( ) ,
11+ getTaskChannels : vi . fn ( ) ,
1312 } ;
1413
1514 await expect ( resolveStartupLocation ( "project" , client ) ) . resolves . toBe (
1615 "/code" ,
1716 ) ;
18- expect ( client . getDesktopFileSystemChannels ) . not . toHaveBeenCalled ( ) ;
17+ expect ( client . getTaskChannels ) . not . toHaveBeenCalled ( ) ;
1918 } ) ;
2019
2120 it ( "opens a new task in me when there is no saved location" , async ( ) => {
2221 vi . spyOn ( stateStorage , "getItem" ) . mockResolvedValue ( null ) ;
2322 const client = {
24- getDesktopFileSystemChannels : vi
25- . fn ( )
26- . mockResolvedValue ( [ { id : "me-id" , path : "me" , type : "folder" } ] ) ,
27- createDesktopFileSystemChannel : vi . fn ( ) ,
23+ getTaskChannels : vi . fn ( ) . mockResolvedValue ( [
24+ {
25+ id : "me-id" ,
26+ name : "me" ,
27+ channel_type : "personal" ,
28+ starred : false ,
29+ } ,
30+ ] ) ,
2831 } ;
2932
3033 await expect ( resolveStartupLocation ( "project" , client ) ) . resolves . toBe (
3134 "/website/me-id/new" ,
3235 ) ;
33- expect ( client . createDesktopFileSystemChannel ) . not . toHaveBeenCalled ( ) ;
36+ expect ( client . getTaskChannels ) . toHaveBeenCalledOnce ( ) ;
3437 } ) ;
3538} ) ;
0 commit comments