Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): skip auxiliary macOS snapshot windows #22624

MergedYoruSamaOG(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/22624/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 202 additions and 0 deletions (loading 1).

x
0 of 2 viewed, 2 left
202 additions and 0 deletionsapps/desktop/src/snapShot/ActiveWindow.test.tsAdded
View file
@@ -0,0 +1,202 @@
+import { assert, beforeEach, it, vi } from "vite-plus/test";
+​
+const { execFileMock } = vi.hoisted(() => ({ execFileMock: vi.fn() }));
+​
+vi.mock("node:child_process", () => ({ execFile: execFileMock }));
+​
+import { activeWindow } from "./ActiveWindow.ts";
+​
+beforeEach(() => {
+ execFileMock.mockReset();
+});
+​
+function stubMacLookup(stdout: string) {
+ execFileMock.mockImplementation(
+ (
+ _file: string,
+ _args: ReadonlyArray<string>,
+ _options: unknown,
+ callback: (error: Error | null, stdout: string) => void,
+ ) => callback(null, stdout),
+ );
+}
+​
+function macLookup(
+ windows: ReadonlyArray<{
+ id: number;
+ title: string;
+ bounds: { x: number; y: number; width: number; height: number };
+ alpha?: number;
+ }>,