@@ -357,6 +357,7 @@ describe("Zen", () => {
357357 ) ;
358358 assert . deepEqual ( zen . alternateLinuxRoots ?.( linuxContext ) , [
359359 linuxContext . path . join ( "/home/zen-user" , ".zen" ) ,
360+ linuxContext . path . join ( "/home/zen-user" , ".var" , "app" , "app.zen_browser.zen" , "zen" ) ,
360361 ] ) ;
361362 } ) ,
362363 ) ,
@@ -472,6 +473,36 @@ describe("Zen", () => {
472473 ) ,
473474 ) ;
474475
476+ it . effect ( "discovers a Flatpak-only Zen installation and resolves its cookies" , ( ) =>
477+ run (
478+ Effect . gen ( function * ( ) {
479+ const fileSystem = yield * FileSystem . FileSystem ;
480+ const home = yield * fileSystem . makeTempDirectoryScoped ( { prefix : "t3code-zen-flatpak-" } ) ;
481+ const context = yield * sourcePathContext . pipe (
482+ Effect . provideService ( HostProcess . Environment , { HOME : home } ) ,
483+ Effect . provideService ( HostProcess . Platform , "linux" ) ,
484+ ) ;
485+ const root = context . path . join ( home , ".var" , "app" , "app.zen_browser.zen" , "zen" ) ;
486+ const profile = context . path . join ( root , "flatpak.default" ) ;
487+ yield * fileSystem . makeDirectory ( profile , { recursive : true } ) ;
488+ yield * writeFirefoxCookieDatabase ( context . path . join ( profile , "cookies.sqlite" ) , 2 , 1 ) ;
489+ yield * fileSystem . writeFileString (
490+ context . path . join ( root , "profiles.ini" ) ,
491+ "[Profile0]\nName=Flatpak\nIsRelative=1\nPath=flatpak.default\n" ,
492+ ) ;
493+
494+ assert . deepEqual ( yield * listSourceProfiles ( zen , context ) , [
495+ { directory : profile , name : "Flatpak" , cookieCount : 2 } ,
496+ ] ) ;
497+ assert . isTrue ( yield * isSourceInstalled ( zen , context ) ) ;
498+ assert . equal (
499+ yield * resolveCookieDatabase ( zen , context , profile ) ,
500+ context . path . join ( profile , "cookies.sqlite" ) ,
501+ ) ;
502+ } ) ,
503+ ) ,
504+ ) ;
505+
475506 it . effect ( "does not mistake Firefox Snap installs for Zen profiles" , ( ) =>
476507 run (
477508 Effect . gen ( function * ( ) {
0 commit comments