summaryrefslogtreecommitdiff
path: root/tests/nowPlaying.test.ts
diff options
context:
space:
mode:
authorxXJSONDeruloXx <danielhimebauch@gmail.com>2026-09-11 11:40:53 -0400
committerxXJSONDeruloXx <danielhimebauch@gmail.com>2026-09-11 11:40:53 -0400
commit4b7852b153106a487ad8fac654ea59f00aa8a8e4 (patch)
tree6d8bc6779197107494cc0f133cd17d59a2c215c1 /tests/nowPlaying.test.ts
parent954b2abc47d8772211cb8ecee523900f823184e8 (diff)
downloaddecky-lsfg-vk-4b7852b153106a487ad8fac654ea59f00aa8a8e4.tar.gz
decky-lsfg-vk-4b7852b153106a487ad8fac654ea59f00aa8a8e4.zip
handle multiple flatpak actives
Diffstat (limited to 'tests/nowPlaying.test.ts')
-rw-r--r--tests/nowPlaying.test.ts10
1 files changed, 10 insertions, 0 deletions
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"));