@@ -179,6 +179,25 @@ describe("DesktopLinuxUrlHandler", () => {
179179 assert . include ( entry , "Icon=/home/al ice/icons/T3\\\\x.png" ) ;
180180 } ) ;
181181
182+ it . each ( [
183+ {
184+ execTarget : "/opt/T3(beta)/t3code.AppImage" ,
185+ execLine : 'Exec="/opt/T3(beta)/t3code.AppImage" %U' ,
186+ } ,
187+ {
188+ execTarget : "/opt/t3%20code/t3code.AppImage" ,
189+ execLine : "Exec=/opt/t3%%20code/t3code.AppImage %U" ,
190+ } ,
191+ ] ) ( "renders the handler Exec line for $execTarget" , ( { execTarget, execLine } ) => {
192+ const entry = DesktopLinuxUrlHandler . renderUrlHandlerDesktopEntry ( {
193+ displayName : "T3 Code" ,
194+ execTarget,
195+ scheme : "t3code" ,
196+ } ) ;
197+
198+ assert . include ( entry . split ( "\n" ) , execLine ) ;
199+ } ) ;
200+
182201 it ( "carries structured context on registration errors" , ( ) => {
183202 const writeError = new DesktopLinuxUrlHandler . DesktopLinuxUrlHandlerRegistrationError ( {
184203 step : "write-desktop-entry" ,
@@ -222,7 +241,7 @@ describe("DesktopLinuxUrlHandler", () => {
222241 ) ;
223242 assert . include (
224243 recorded . files [ 0 ] ?. content ,
225- ' Exec=" /home/alice/Applications/T3-Code.AppImage" %U' ,
244+ " Exec=/home/alice/Applications/T3-Code.AppImage %U" ,
226245 ) ;
227246 assert . include ( recorded . files [ 0 ] ?. content , "MimeType=x-scheme-handler/t3code;" ) ;
228247 assert . deepEqual ( recorded . commands , [
@@ -247,7 +266,12 @@ describe("DesktopLinuxUrlHandler", () => {
247266
248267 assert . include (
249268 recorded . files [ 0 ] ?. content ,
250- `Exec=${ DesktopLinuxUrlHandler . escapeDesktopEntryExecArgument ( process . execPath ) } %U` ,
269+ DesktopLinuxUrlHandler . renderUrlHandlerDesktopEntry ( {
270+ displayName : "T3 Code (Alpha)" ,
271+ execTarget : process . execPath ,
272+ scheme : "t3code" ,
273+ iconPath : "/home/alice/.local/share/icons/com.t3tools.T3Code.desktop.png" ,
274+ } ) ,
251275 ) ;
252276 } ) ;
253277 } ) ;
0 commit comments