From 4b7852b153106a487ad8fac654ea59f00aa8a8e4 Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Fri, 11 Sep 2026 11:40:53 -0400 Subject: handle multiple flatpak actives --- tests/nowPlaying.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/nowPlaying.test.ts b/tests/nowPlaying.test.ts index 8a52b67..c99ffc4 100644 --- a/tests/nowPlaying.test.ts +++ b/tests/nowPlaying.test.ts @@ -47,6 +47,16 @@ test("prefers active Flatpak status before process age", () => { assert.equal(selectMostRecentRunningFlatpak(apps, running)?.app_id, "org.example.active"); }); +test("deduplicates multiple process rows for one managed Flatpak", () => { + const apps = [flatpak("com.heroicgameslauncher.hgl")]; + const running = [ + { app_id: "com.heroicgameslauncher.hgl", active: false, pid: "228081", start_time: null }, + { app_id: "com.heroicgameslauncher.hgl", active: false, pid: "228116", start_time: null }, + ]; + + assert.equal(selectMostRecentRunningFlatpak(apps, running)?.app_id, "com.heroicgameslauncher.hgl"); +}); + test("Flatpak runtime wins while a Steam shortcut is running", () => { const target = resolveNowPlayingTarget(game(true), flatpak("org.libretro.RetroArch", "RetroArch")); -- cgit v1.2.3