@@ -103,19 +103,19 @@ it("stays hidden where the server has no hand-off (the desktop's own Studio)", a
103103 expect ( button ( ) ) . toBeNull ( ) ;
104104} ) ;
105105
106- it ( "stays hidden when the app has no build for this machine (Windows )" , async ( ) => {
106+ it ( "stays hidden when the app has no build for this machine (FreeBSD )" , async ( ) => {
107107 serve ( Response . json ( { available : false , handoff : true , downloadUrl : null } ) ) ;
108108 await mount ( ) ;
109109 expect ( button ( ) ) . toBeNull ( ) ;
110110} ) ;
111111
112- it ( "with the app installed but no download (Windows ), shows only once the app can take the project" , async ( ) => {
112+ it ( "with the app installed but no download (FreeBSD ), shows only once the app can take the project" , async ( ) => {
113113 serve ( Response . json ( { available : true , handoff : false , downloadUrl : null } ) ) ;
114114 await mount ( ) ;
115115 expect ( button ( ) ) . toBeNull ( ) ;
116116} ) ;
117117
118- it ( "opens the project in an installed app that has no download (Windows )" , async ( ) => {
118+ it ( "opens the project in an installed app that has no download (FreeBSD )" , async ( ) => {
119119 serve ( Response . json ( { available : true , handoff : true , downloadUrl : null } ) , {
120120 opened : true ,
121121 app : "the HyperFrames desktop app" ,
@@ -381,6 +381,28 @@ it("where the app is installed but cannot take a project (Linux), step 3 shows t
381381 expect ( posts ) . toBe ( 0 ) ;
382382} ) ;
383383
384+ it ( "on Windows, step 1 names the Windows download and opens it tagged" , async ( ) => {
385+ const opened : string [ ] = [ ] ;
386+ vi . stubGlobal ( "open" , ( url : string ) => ( opened . push ( url ) , { opener : { } } ) ) ;
387+ serve (
388+ Response . json ( {
389+ available : true ,
390+ handoff : false ,
391+ downloadUrl : `${ DOWNLOAD } ?os=windows` ,
392+ os : "win32" ,
393+ installed : false ,
394+ } ) ,
395+ ) ;
396+ await mount ( ) ;
397+ expect ( button ( ) ) . not . toBeNull ( ) ;
398+ await act ( async ( ) => button ( ) ! . click ( ) ) ;
399+ await act ( async ( ) => cardButton ( "Download for Windows" ) ! . click ( ) ) ;
400+ expect ( opened ) . toEqual ( [ tagged ( `${ DOWNLOAD } ?os=windows` ) ] ) ;
401+ expect ( events ( "desktop_cta_eligibility" ) ) . toEqual ( [
402+ { eligibility : "download" , os : "win32" , app_installed : false , download_available : true } ,
403+ ] ) ;
404+ } ) ;
405+
384406it ( "counts where the button can show, the app here, and platforms with no app" , async ( ) => {
385407 serve (
386408 Response . json ( {
@@ -402,7 +424,7 @@ it("counts where the button can show, the app here, and platforms with no app",
402424 available : false ,
403425 handoff : false ,
404426 downloadUrl : null ,
405- os : "win32 " ,
427+ os : "freebsd " ,
406428 installed : false ,
407429 } ) ,
408430 ) ;
@@ -411,7 +433,7 @@ it("counts where the button can show, the app here, and platforms with no app",
411433 expect ( events ( "desktop_cta_eligibility" ) ) . toEqual ( [
412434 {
413435 eligibility : "no_app_for_platform" ,
414- os : "win32 " ,
436+ os : "freebsd " ,
415437 app_installed : false ,
416438 download_available : false ,
417439 } ,
0 commit comments