@@ -29,27 +29,33 @@ const makeProjectConfig = (overrides: Partial<ProjectConfig["template"]> = {}):
2929describe ( "formatConnectionInfo" , ( ) => {
3030 it ( "includes clonedOnHostname when present" , ( ) => {
3131 const config = makeProjectConfig ( { clonedOnHostname : "my-laptop" } )
32- const output = formatConnectionInfo ( "/project" , config , "/keys" , true , "ssh dev@localhost" )
32+ const output = formatConnectionInfo ( "/project" , config , {
33+ authorizedKeysPath : "/keys" ,
34+ authorizedKeysExists : true ,
35+ sshCommand : "ssh dev@localhost"
36+ } )
3337 expect ( output ) . toContain ( "Cloned on device: my-laptop" )
3438 } )
3539
3640 it ( "omits clonedOnHostname line when undefined" , ( ) => {
3741 const config = makeProjectConfig ( )
38- const output = formatConnectionInfo ( "/project" , config , "/keys" , true , "ssh dev@localhost" )
42+ const output = formatConnectionInfo ( "/project" , config , {
43+ authorizedKeysPath : "/keys" ,
44+ authorizedKeysExists : true ,
45+ sshCommand : "ssh dev@localhost"
46+ } )
3947 expect ( output ) . not . toContain ( "Cloned on device" )
4048 } )
4149
4250 it ( "includes Remote-SSH details when provided" , ( ) => {
4351 const config = makeProjectConfig ( { clonedOnHostname : "meadav" } )
4452 const editorAccess = buildEditorSshAccess ( config . template , "/home/user/.ssh/id_ed25519" )
45- const output = formatConnectionInfo (
46- "/project" ,
47- config ,
48- "/keys" ,
49- true ,
50- "ssh dev@localhost" ,
51- formatEditorSshAccessDetails ( editorAccess , config . template . clonedOnHostname )
52- )
53+ const output = formatConnectionInfo ( "/project" , config , {
54+ authorizedKeysPath : "/keys" ,
55+ authorizedKeysExists : true ,
56+ sshCommand : "ssh dev@localhost" ,
57+ editorAccessDetails : formatEditorSshAccessDetails ( editorAccess , config . template . clonedOnHostname )
58+ } )
5359 expect ( output ) . toContain ( "Remote-SSH host: dg-test" )
5460 expect ( output ) . toContain ( "Terminal shortcut: ssh dg-test" )
5561 expect ( output ) . toContain ( "VS Code/Cursor: Connect to Host... -> dg-test" )
0 commit comments