summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorxXJSONDeruloXx <danielhimebauch@gmail.com>2026-09-10 15:11:51 -0400
committerxXJSONDeruloXx <danielhimebauch@gmail.com>2026-09-10 15:11:51 -0400
commita7b7e22968480c0b57f9a0335ee30e27baa9b88d (patch)
tree80a7b5bdf76a23cc108563c694d9a4b9fc31dfa1 /tests
parent29dc8a0a243147c26ca49494155ae089b0c6fd80 (diff)
downloaddecky-lsfg-vk-refactor/flatpak-capability.tar.gz
decky-lsfg-vk-refactor/flatpak-capability.zip
fix: canonicalize existing Flatpak targetsrefactor/flatpak-capability
Diffstat (limited to 'tests')
-rw-r--r--tests/steamLaunchOptions.test.ts31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/steamLaunchOptions.test.ts b/tests/steamLaunchOptions.test.ts
index 0559330..cdf0cf2 100644
--- a/tests/steamLaunchOptions.test.ts
+++ b/tests/steamLaunchOptions.test.ts
@@ -192,6 +192,37 @@ test("wraps a split direct Flatpak target while preserving its launch arguments"
}
});
+test("canonicalizes an existing quoted direct Flatpak target", async () => {
+ const previousWindow = (globalThis as Record<string, unknown>).window;
+ const previousSteamClient = (globalThis as Record<string, unknown>).SteamClient;
+ let shortcutTarget = '"~/.lsfg" "/usr/bin/flatpak"';
+ const targetWrites: string[] = [];
+ const apps = {
+ RegisterForAppDetails(_appId: number, callback: (details: SteamAppDetails) => void) {
+ callback({ strShortcutExe: shortcutTarget, strShortcutLaunchOptions: "" });
+ return { unregister() {} };
+ },
+ SetShortcutExe(_appId: number, executable: string) {
+ targetWrites.push(executable);
+ shortcutTarget = executable;
+ },
+ SetShortcutLaunchOptions() {},
+ };
+ (globalThis as Record<string, unknown>).window = { setTimeout, clearTimeout };
+ (globalThis as Record<string, unknown>).SteamClient = { Apps: apps };
+ try {
+ const installed = await installWrapperIntegration(47, true, wrapper, false, { kind: "flatpak" });
+ assert.equal(installed.originalExecutable, "/usr/bin/flatpak");
+ assert.equal(installed.snapshot.target, "~/.lsfg /usr/bin/flatpak");
+ assert.deepEqual(targetWrites, ["~/.lsfg /usr/bin/flatpak"]);
+ } finally {
+ if (previousWindow === undefined) delete (globalThis as Record<string, unknown>).window;
+ else (globalThis as Record<string, unknown>).window = previousWindow;
+ if (previousSteamClient === undefined) delete (globalThis as Record<string, unknown>).SteamClient;
+ else (globalThis as Record<string, unknown>).SteamClient = previousSteamClient;
+ }
+});
+
test("uses shortcut launch options for a host shortcut without changing its Target", async () => {
const previousWindow = (globalThis as Record<string, unknown>).window;
const previousSteamClient = (globalThis as Record<string, unknown>).SteamClient;